diff --git a/Conditional Formatting/Create Conditional Format/.NET/Create Conditional Format/Create Conditional Format/Program.cs b/Conditional Formatting/Create Conditional Format/.NET/Create Conditional Format/Create Conditional Format/Program.cs index 9ef6bf65..b287530f 100644 --- a/Conditional Formatting/Create Conditional Format/.NET/Create Conditional Format/Create Conditional Format/Program.cs +++ b/Conditional Formatting/Create Conditional Format/.NET/Create Conditional Format/Create Conditional Format/Program.cs @@ -14,8 +14,8 @@ static void Main(string[] args) IWorkbook workbook = application.Workbooks.Create(1); IWorksheet worksheet = workbook.Worksheets[0]; - //Applying conditional formatting to "A1" - IConditionalFormats condition = worksheet.Range["A1"].ConditionalFormats; + //Applying conditional formatting to "F2" + IConditionalFormats condition = worksheet.Range["F2"].ConditionalFormats; IConditionalFormat condition1 = condition.AddCondition(); //Represents conditional format rule that the value in target range should be between 10 and 20 @@ -23,36 +23,39 @@ static void Main(string[] args) condition1.Operator = ExcelComparisonOperator.Between; condition1.FirstFormula = "10"; condition1.SecondFormula = "20"; - worksheet.Range["A1"].Text = "Enter a number between 10 and 20"; + worksheet.Range["A2"].Text = "Enter a number between 10 and 20"; + worksheet.Range["F2"].BorderAround(ExcelLineStyle.Thin); //Setting back color and font style to be applied for target range condition1.BackColor = ExcelKnownColors.Light_orange; condition1.IsBold = true; condition1.IsItalic = true; - //Applying conditional formatting to "A3" - condition = worksheet.Range["A3"].ConditionalFormats; + //Applying conditional formatting to "F4" + condition = worksheet.Range["F4"].ConditionalFormats; IConditionalFormat condition2 = condition.AddCondition(); //Represents conditional format rule that the cell value should be 1000 condition2.FormatType = ExcelCFType.CellValue; condition2.Operator = ExcelComparisonOperator.Equal; condition2.FirstFormula = "1000"; - worksheet.Range["A3"].Text = "Enter the Number as 1000"; + worksheet.Range["A4"].Text = "Enter the Number as 1000"; + worksheet.Range["F4"].BorderAround(ExcelLineStyle.Thin); //Setting fill pattern and back color to target range condition2.FillPattern = ExcelPattern.LightUpwardDiagonal; condition2.BackColor = ExcelKnownColors.Yellow; - //Applying conditional formatting to "A5" - condition = worksheet.Range["A5"].ConditionalFormats; + //Applying conditional formatting to "F6" + condition = worksheet.Range["F6"].ConditionalFormats; IConditionalFormat condition3 = condition.AddCondition(); //Setting conditional format rule that the cell value for target range should be less than or equal to 1000 condition3.FormatType = ExcelCFType.CellValue; condition3.Operator = ExcelComparisonOperator.LessOrEqual; condition3.FirstFormula = "1000"; - worksheet.Range["A5"].Text = "Enter a Number which is less than or equal to 1000"; + worksheet.Range["A6"].Text = "Enter a Number which is less than or equal to 1000"; + worksheet.Range["F6"].BorderAround(ExcelLineStyle.Thin); //Setting back color to target range condition3.BackColor = ExcelKnownColors.Light_green; diff --git a/Convert Excel to JSON/Workbook to JSON with Schema/.NET/Workbook to JSON with Schema/Workbook to JSON with Schema/Program.cs b/Convert Excel to JSON/Workbook to JSON with Schema/.NET/Workbook to JSON with Schema/Workbook to JSON with Schema/Program.cs index 00008c17..53ae3908 100644 --- a/Convert Excel to JSON/Workbook to JSON with Schema/.NET/Workbook to JSON with Schema/Workbook to JSON with Schema/Program.cs +++ b/Convert Excel to JSON/Workbook to JSON with Schema/.NET/Workbook to JSON with Schema/Workbook to JSON with Schema/Program.cs @@ -22,7 +22,7 @@ static void Main(string[] args) workbook.SaveAsJson(outputStream); //Saves the workbook to a JSON filestream as schema - FileStream stream1 = new FileStream("Output/Excel-Workbook-To-JSON-as-schema.json", FileMode.Create, FileAccess.ReadWrite); + FileStream stream1 = new FileStream(Path.GetFullPath("Output/Excel-Workbook-To-JSON-as-schema.json"), FileMode.Create, FileAccess.ReadWrite); workbook.SaveAsJson(stream1, true); #endregion diff --git a/XlsIO-Excel-Protect-UnProtect/Protect-Workbook/.NET/Protect-Workbook/ProtectWorkbook/README.md b/XlsIO-Excel-Protect-UnProtect/Protect-Workbook/.NET/Protect-Workbook/ProtectWorkbook/README.md index 331b557b..7bc3805f 100644 --- a/XlsIO-Excel-Protect-UnProtect/Protect-Workbook/.NET/Protect-Workbook/ProtectWorkbook/README.md +++ b/XlsIO-Excel-Protect-UnProtect/Protect-Workbook/.NET/Protect-Workbook/ProtectWorkbook/README.md @@ -1,6 +1,6 @@ # Protect a workbook with a password using C# -The Syncfusion® [.NET Excel Library](https://www.syncfusion.com/document-processing/excel-framework/net/excel-library) (XlsIO) enables you to create, read, and edit Excel documents programmatically without Microsoft Excel or interop dependencies. Using this library, you can **protect a workbook with a password** using C#. +The Syncfusion® [.NET Excel Library](https://www.syncfusion.com/document-processing/excel-framework/net/excel-library) (XlsIO) enables you to create, read, and edit Excel documents programmatically without Microsoft Excel or interop dependencies. Using this library, you can **protect a workbook with a password** using C#. After adding workbook protection, the structural changes of the workbook are disabled. ## Steps to protect a workbook with a password programmatically