Skip to content

PR related to Issue #54 #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
################################################################################
# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
################################################################################

/Read and Edit Excel/Read and Edit Excel/NET Standard/Read and Edit Excel/.vs
/Read and Edit Excel/Read and Edit Excel/NET Standard/Read and Edit Excel/Read and Edit Excel/bin/Debug/net7.0
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31729.503
# Visual Studio Version 17
VisualStudioVersion = 17.8.34112.27
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Read and Edit Excel", "Read and Edit Excel\Read and Edit Excel.csproj", "{AAEDFC24-300B-4516-AAC0-2F12FD288805}"
EndProject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
using Syncfusion.XlsIO;
using System.IO;
using System.IO;
using Syncfusion.XlsIO;

namespace Read_and_Edit_Excel
{
class Program
internal class Program
{
static void Main(string[] args)
private static void Main(string[] args)
{
//Creates a new instance for ExcelEngine
ExcelEngine excelEngine = new ExcelEngine();

#region Open
//Loads or open an existing workbook through Open method of IWorkbook
FileStream inputStream = new FileStream("../../../InputTemplate.xlsx", FileMode.Open, FileAccess.Read);
IWorkbook workbook = excelEngine.Excel.Workbooks.Open(inputStream);
#endregion

//Set the version of the workbook
workbook.Version = ExcelVersion.Xlsx;

#region Edit
//Set a value in Excel cell
workbook.Worksheets[0].Range["A2"].Value = "Hello World";
#endregion

#region Save
//Saving the workbook
FileStream outputStream = new FileStream("ReadandEditExcel.xlsx", FileMode.Create, FileAccess.Write);
workbook.SaveAs(outputStream);
#endregion

#region Close
//Close the instance of IWorkbook
workbook.Close();
#endregion

//Dispose streams
outputStream.Dispose();
inputStream.Dispose();

//Dispose the instance of ExcelEngine
excelEngine.Dispose();

System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo = new System.Diagnostics.ProcessStartInfo("ReadandEditExcel.xlsx")
//Creates a new instance for ExcelEngine, and will Close on exiting using block
using (var excelEngine = new ExcelEngine())
{
IWorkbook workbook; // N.B. IWorkbook is not IDisposable so can't wrap in using, hence explicit Close below

#region Open
// open an existing workbook through Open method of IWorkbooks, needs explicit ExcelVersion if writing (see below)
// N.B. input .xlsx file was copied to output folder at build time
using (var inputStream = new FileStream("InputTemplate.xlsx", FileMode.Open, FileAccess.Read))
{
workbook = excelEngine.Excel.Workbooks.Open(inputStream, ExcelVersion.Xlsx);
}
#endregion

#region Edit
//Set a value in Excel cell
workbook.Worksheets[0].Range["A2"].Value = "Hello World";
#endregion

#region Save
//Saving the workbook
using (var outputStream = new FileStream("ReadandEditExcel.xlsx", FileMode.Create, FileAccess.Write))
{
workbook.SaveAs(outputStream);
}
#endregion

#region Close
//Close the instance of IWorkbook
workbook.Close();
#endregion

}
var process = new System.Diagnostics.Process
{
UseShellExecute = true
StartInfo = new System.Diagnostics.ProcessStartInfo("ReadandEditExcel.xlsx")
{
UseShellExecute = true
}
};
process.Start();
_ = process.Start();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace>Read and Edit Excel</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.XlsIO.NET" Version="19.4.0.38" />
</ItemGroup>

<ItemGroup>
<None Update="InputTemplate.xlsx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v7.0", FrameworkDisplayName = ".NET 7.0")]
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyCompanyAttribute("Read and Edit Excel")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+04d2d63b49d2d412baf93a667c7aa70cb605226e")]
[assembly: System.Reflection.AssemblyProductAttribute("Read and Edit Excel")]
[assembly: System.Reflection.AssemblyTitleAttribute("Read and Edit Excel")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

// Generated by the MSBuild WriteCodeFragment class.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
01a17efc6d80784250f1e7b6ed913cd73ccf40bf60ef89157f35f379fa4a1c4c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
is_global = true
build_property.TargetFramework = net7.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Read and Edit Excel
build_property.ProjectDir = F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
98aa11b67bcfd34995a437fc202f0dbc50f5cca9d1dbfc20398ccea4e34d694a
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\bin\Debug\net7.0\Read and Edit Excel.exe
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\bin\Debug\net7.0\Read and Edit Excel.deps.json
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\bin\Debug\net7.0\Read and Edit Excel.runtimeconfig.json
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\bin\Debug\net7.0\Read and Edit Excel.dll
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\bin\Debug\net7.0\Read and Edit Excel.pdb
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\bin\Debug\net7.0\Syncfusion.Compression.NET.dll
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\bin\Debug\net7.0\Syncfusion.Licensing.dll
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\bin\Debug\net7.0\Syncfusion.XlsIO.NET.dll
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\obj\Debug\net7.0\Read and Edit Excel.csproj.AssemblyReference.cache
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\obj\Debug\net7.0\Read and Edit Excel.GeneratedMSBuildEditorConfig.editorconfig
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\obj\Debug\net7.0\Read and Edit Excel.AssemblyInfoInputs.cache
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\obj\Debug\net7.0\Read and Edit Excel.AssemblyInfo.cs
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\obj\Debug\net7.0\Read and Edit Excel.csproj.CoreCompileInputs.cache
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\obj\Debug\net7.0\Read and Edit Excel.sourcelink.json
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\obj\Debug\net7.0\Read and Edit Excel.csproj.CopyComplete
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\obj\Debug\net7.0\Read and Edit Excel.dll
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\obj\Debug\net7.0\refint\Read and Edit Excel.dll
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\obj\Debug\net7.0\Read and Edit Excel.pdb
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\obj\Debug\net7.0\Read and Edit Excel.genruntimeconfig.cache
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\obj\Debug\net7.0\ref\Read and Edit Excel.dll
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\bin\Debug\net7.0\InputTemplate.xlsx
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9075898ca2572db1466fe13e4df7d140b6febdf4e7bc1066daa069733171f956
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"documents":{"F:\\Dev\\XlsIO-Examples\\*":"https://raw.githubusercontent.com/SyncfusionExamples/XlsIO-Examples/04d2d63b49d2d412baf93a667c7aa70cb605226e/*"}}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v3.1", FrameworkDisplayName = ".NET Core 3.1")]
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyCompanyAttribute("Read and Edit Excel")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("Read and Edit Excel")]
[assembly: System.Reflection.AssemblyTitleAttribute("Read and Edit Excel")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

// Generated by the MSBuild WriteCodeFragment class.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
79760a412950e8e15fc5eb47bb67d7def5b190f1ec91dbe36046fdad4cc143ee
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
is_global = true
build_property.RootNamespace = Read and Edit Excel
build_property.ProjectDir = F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3ee812e8b3d69d4717ed9040fa265ec591f61d32609880662935fcd59299c627
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\bin\Debug\netcoreapp3.1\Read and Edit Excel.exe
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\bin\Debug\netcoreapp3.1\Read and Edit Excel.deps.json
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\bin\Debug\netcoreapp3.1\Read and Edit Excel.runtimeconfig.json
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\bin\Debug\netcoreapp3.1\Read and Edit Excel.runtimeconfig.dev.json
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\bin\Debug\netcoreapp3.1\Read and Edit Excel.dll
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\bin\Debug\netcoreapp3.1\Read and Edit Excel.pdb
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\bin\Debug\netcoreapp3.1\Syncfusion.Compression.NET.dll
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\bin\Debug\netcoreapp3.1\Syncfusion.Licensing.dll
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\bin\Debug\netcoreapp3.1\Syncfusion.XlsIO.NET.dll
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\obj\Debug\netcoreapp3.1\Read and Edit Excel.csproj.AssemblyReference.cache
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\obj\Debug\netcoreapp3.1\Read and Edit Excel.GeneratedMSBuildEditorConfig.editorconfig
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\obj\Debug\netcoreapp3.1\Read and Edit Excel.AssemblyInfoInputs.cache
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\obj\Debug\netcoreapp3.1\Read and Edit Excel.AssemblyInfo.cs
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\obj\Debug\netcoreapp3.1\Read and Edit Excel.csproj.CoreCompileInputs.cache
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\obj\Debug\netcoreapp3.1\Read and Edit Excel.sourcelink.json
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\obj\Debug\netcoreapp3.1\Read and Edit Excel.csproj.CopyComplete
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\obj\Debug\netcoreapp3.1\Read and Edit Excel.dll
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\obj\Debug\netcoreapp3.1\Read and Edit Excel.pdb
F:\Dev\XlsIO-Examples\Read and Edit Excel\Read and Edit Excel\NET Standard\Read and Edit Excel\Read and Edit Excel\obj\Debug\netcoreapp3.1\Read and Edit Excel.genruntimeconfig.cache
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6741747c361a5b9998087b18d4592b1efcae345195a721d434336ba0df2bccac
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"documents":{"F:\\Dev\\XlsIO-Examples\\*":"https://raw.githubusercontent.com/SyncfusionExamples/XlsIO-Examples/04d2d63b49d2d412baf93a667c7aa70cb605226e/*"}}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"format": 1,
"restore": {
"F:\\Dev\\XlsIO-Examples\\Read and Edit Excel\\Read and Edit Excel\\NET Standard\\Read and Edit Excel\\Read and Edit Excel\\Read and Edit Excel.csproj": {}
},
"projects": {
"F:\\Dev\\XlsIO-Examples\\Read and Edit Excel\\Read and Edit Excel\\NET Standard\\Read and Edit Excel\\Read and Edit Excel\\Read and Edit Excel.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "F:\\Dev\\XlsIO-Examples\\Read and Edit Excel\\Read and Edit Excel\\NET Standard\\Read and Edit Excel\\Read and Edit Excel\\Read and Edit Excel.csproj",
"projectName": "Read and Edit Excel",
"projectPath": "F:\\Dev\\XlsIO-Examples\\Read and Edit Excel\\Read and Edit Excel\\NET Standard\\Read and Edit Excel\\Read and Edit Excel\\Read and Edit Excel.csproj",
"packagesPath": "C:\\Users\\DickB\\.nuget\\packages\\",
"outputPath": "F:\\Dev\\XlsIO-Examples\\Read and Edit Excel\\Read and Edit Excel\\NET Standard\\Read and Edit Excel\\Read and Edit Excel\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages",
"C:\\Program Files (x86)\\Syncfusion\\Essential Studio\\WPF\\22.1.34\\ToolboxNuGetPackages",
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"
],
"configFilePaths": [
"C:\\Users\\DickB\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Syncfusion Toolbox for WPF.config"
],
"originalTargetFrameworks": [
"net7.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files (x86)\\Syncfusion\\Essential Studio\\WinUI\\22.1.34\\NuGetPackages": {},
"C:\\Program Files\\dotnet\\library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net7.0": {
"targetAlias": "net7.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net7.0": {
"targetAlias": "net7.0",
"dependencies": {
"Syncfusion.XlsIO.NET": {
"target": "Package",
"version": "[19.4.0.38, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.100-rc.1.23455.8\\RuntimeIdentifierGraph.json"
}
}
}
}
}
Loading