Skip to content

Commit 187509a

Browse files
944873-ParseWorksheetsOnDemandExample
1 parent 3e40040 commit 187509a

File tree

6 files changed

+114
-0
lines changed

6 files changed

+114
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.12.35506.116 d17.12
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Parse Worksheets On Demand", "Parse Worksheets On Demand\Parse Worksheets On Demand.csproj", "{A53113E8-EBC9-4BAD-B29D-59FDA607B4C7}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{A53113E8-EBC9-4BAD-B29D-59FDA607B4C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{A53113E8-EBC9-4BAD-B29D-59FDA607B4C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{A53113E8-EBC9-4BAD-B29D-59FDA607B4C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{A53113E8-EBC9-4BAD-B29D-59FDA607B4C7}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal
Binary file not shown.

FAQ/Worksheet/.NET/Parse Worksheets On Demand/Parse Worksheets On Demand/Output/.gitkeep

Whitespace-only changes.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<RootNamespace>Parse_Worksheets_On_Demand</RootNamespace>
7+
<ImplicitUsings>enable</ImplicitUsings>
8+
<Nullable>enable</Nullable>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="Syncfusion.XlsIO.Net.Core" Version="*" />
13+
</ItemGroup>
14+
15+
<ItemGroup>
16+
<None Update="Output\*">
17+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
18+
</None>
19+
</ItemGroup>
20+
21+
</Project>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System;
2+
using System.IO;
3+
using Syncfusion.XlsIO;
4+
5+
6+
7+
namespace Delete_Hyperlinks
8+
{
9+
class Program
10+
{
11+
static void Main(string[] args)
12+
{
13+
using (ExcelEngine excelEngine = new ExcelEngine())
14+
{
15+
IApplication application = excelEngine.Excel;
16+
application.DefaultVersion = ExcelVersion.Xlsx;
17+
FileStream inputStream = new FileStream("Data/Input.xlsx", FileMode.Open, FileAccess.Read);
18+
IWorkbook workbook = application.Workbooks.Open(inputStream, ExcelOpenType.Automatic, ExcelParseOptions.ParseWorksheetsOnDemand);
19+
20+
// Access the first worksheet (triggers parsing)
21+
IWorksheet worksheet = workbook.Worksheets[0];
22+
23+
// Process your data
24+
string value = worksheet.Range["A1"].Text;
25+
26+
// Save to file system
27+
FileStream stream = new FileStream("Output/Output.xlsx", FileMode.OpenOrCreate, FileAccess.ReadWrite);
28+
workbook.SaveAs(stream);
29+
workbook.Close();
30+
excelEngine.Dispose();
31+
}
32+
33+
}
34+
35+
}
36+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# : How to parse worksheets on demand in Excel document?
2+
3+
Step 1: Create a New C# Console Application Project.
4+
5+
Step 2: Name the Project.
6+
7+
Step 3: Install the [Syncfusion.XlsIO.Net.Core](https://www.nuget.org/packages/Syncfusion.XlsIO.Net.Core) NuGet package as reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org).
8+
9+
Step 4: Include the following namespaces in the **Program.cs** file.
10+
11+
```csharp
12+
using System;
13+
using System.IO;
14+
using Syncfusion.XlsIO;
15+
16+
Step 5: Include the below code snippet in **Program.cs** to parse worksheets on demand in Excel document.
17+
```csharp
18+
using (ExcelEngine excelEngine = new ExcelEngine())
19+
{
20+
IApplication application = excelEngine.Excel;
21+
application.DefaultVersion = ExcelVersion.Xlsx;
22+
FileStream inputStream = new FileStream("Input.xlsx", FileMode.Open, FileAccess.Read);
23+
IWorkbook workbook = application.Workbooks.Open(inputStream,ExcelOpenType.Automatic, ExcelParseOptions.ParseWorksheetsOnDemand);
24+
// Access the first worksheet (triggers parsing)
25+
IWorksheet worksheet = workbook.Worksheets[0];
26+
// Process your data
27+
string value = worksheet.Range["A1"].Text;
28+
// Save to file system
29+
FileStream stream = new FileStream("Output.xlsx", FileMode.OpenOrCreate, FileAccess.ReadWrite);
30+
workbook.SaveAs(stream);
31+
workbook.Close();
32+
excelEngine.Dispose();
33+
}
34+
```
35+

0 commit comments

Comments
 (0)