File tree Expand file tree Collapse file tree 5 files changed +52
-0
lines changed
Data Validation/Remove Validation/.NET/Remove Validation Expand file tree Collapse file tree 5 files changed +52
-0
lines changed Original file line number Diff line number Diff line change 1+ <Solution >
2+ <Project Path =" Remove Validation/Remove Validation.csproj" />
3+ </Solution >
Original file line number Diff line number Diff line change 1+ using System . IO ;
2+ using Syncfusion . XlsIO ;
3+
4+ namespace Remove_Validation
5+ {
6+ class Program
7+ {
8+ static void Main ( string [ ] args )
9+ {
10+ using ( ExcelEngine excelEngine = new ExcelEngine ( ) )
11+ {
12+ IApplication application = excelEngine . Excel ;
13+ application . DefaultVersion = ExcelVersion . Xlsx ;
14+ IWorkbook workbook = application . Workbooks . Open ( Path . GetFullPath ( @"../../../Data/InputTemplate.xlsx" ) ) ;
15+ IWorksheet worksheet = workbook . Worksheets [ 0 ] ;
16+
17+ //Removing data validation from the worksheet
18+ worksheet . UsedRange . Clear ( ExcelClearOptions . ClearDataValidations ) ;
19+
20+ //Saving the workbook
21+ workbook . SaveAs ( Path . GetFullPath ( @"../../../Output/Output.xlsx" ) ) ;
22+ }
23+ }
24+ }
25+ }
Original file line number Diff line number Diff line change 1+ <Project Sdk =" Microsoft.NET.Sdk" >
2+
3+ <PropertyGroup >
4+ <OutputType >Exe</OutputType >
5+ <TargetFramework >net10.0</TargetFramework >
6+ <RootNamespace >Remove_Validation</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+ <None Update =" Data\*" >
20+ <CopyToOutputDirectory >Always</CopyToOutputDirectory >
21+ </None >
22+ </ItemGroup >
23+
24+ </Project >
You can’t perform that action at this time.
0 commit comments