From cd3b9b493b09c04eee5c61185b4b0d8572b6d2d4 Mon Sep 17 00:00:00 2001 From: VinothSF5015 Date: Tue, 5 May 2026 17:03:57 +0530 Subject: [PATCH 1/7] 992377 - Sample Added --- Document-Processing-toc.html | 17 ++-- ...readonly-option-in-ms-excel-using-xlsio.md | 94 +++++++++++++++++++ 2 files changed, 104 insertions(+), 7 deletions(-) create mode 100644 Document-Processing/Excel/Excel-Library/NET/faqs/how-to-open-excel-file-as-readonly-option-in-ms-excel-using-xlsio.md diff --git a/Document-Processing-toc.html b/Document-Processing-toc.html index 26c1bfa6f..0e88751ea 100644 --- a/Document-Processing-toc.html +++ b/Document-Processing-toc.html @@ -6748,17 +6748,17 @@
  • How to remove all the ListObjects from the sheet?
  • -
  • +
  • How to assign cell value without changing the format type in XlsIO?
  • How to retrieve data from merged cells using XlsIO?
  • -
  • +
  • How to convert inches to points in Syncfusion XlsIO? -
  • -
  • - How to preserve line breaks when saving Excel as CSV? +
  • +
  • + How to preserve line breaks when saving Excel as CSV?
  • Why does text with double quotes get enclosed in double quotes when saving as CSV? @@ -6766,12 +6766,15 @@
  • How to detect whether a column is hidden in an Excel file using XlsIO?
  • -
  • +
  • How to set invert if negative option for a chart using XLsIO?
  • -
  • +
  • How to merge cells preserving topleft value and format in XlsIO?
  • +
  • + How to open Excel file as ReadOnly in MS Excel using XlsIO? +
  • diff --git a/Document-Processing/Excel/Excel-Library/NET/faqs/how-to-open-excel-file-as-readonly-option-in-ms-excel-using-xlsio.md b/Document-Processing/Excel/Excel-Library/NET/faqs/how-to-open-excel-file-as-readonly-option-in-ms-excel-using-xlsio.md new file mode 100644 index 000000000..cc1c4f612 --- /dev/null +++ b/Document-Processing/Excel/Excel-Library/NET/faqs/how-to-open-excel-file-as-readonly-option-in-ms-excel-using-xlsio.md @@ -0,0 +1,94 @@ +--- +title: How to open Excel file as ReadOnly in MS Excel using XlsIO? | Syncfusion +description: Shows how to set the 'Read-only recommended' flag when saving an Excel workbook with Syncfusion XlsIO so Excel prompts to open it as read-only. +platform: document-processing +control: XlsIO +documentation: UG +--- + +# How to open Excel file as ReadOnly in MS Excel using XlsIO? + +You can make Excel prompt users to open a workbook as read-only by setting the Read-only recommended flag on the workbook before saving. The example below shows how to set this flag with Syncfusion XlsIO and save the file so Microsoft Excel offers the "Read-only recommended" option when the file is opened. + +The following code examples illustrate this. + +{% tabs %} +{% highlight c# tabtitle="C# [Cross-platform]" %} +using (ExcelEngine excelEngine = new ExcelEngine()) +{ + // Instantiate the Excel application object + IApplication application = excelEngine.Excel; + + // Assigns default application version + application.DefaultVersion = ExcelVersion.Xlsx; + + // Create a workbook with 1 worksheet + IWorkbook workbook = application.Workbooks.Create(1); + + // Access first worksheet from the workbook + IWorksheet worksheet = workbook.Worksheets[0]; + + // Adding text to a cell + worksheet.Range["A1"].Text = "Hello World"; + + // Protect the worksheet + worksheet.Protect("syncfusion", ExcelSheetProtection.All); + + // Save the workbook to disk in XLSX format + workbook.SaveAs(Path.GetFullPath("Output/Output.xlsx")); +} +{% endhighlight %} + +{% highlight c# tabtitle="C# [Windows-specific]" %} +using (ExcelEngine excelEngine = new ExcelEngine()) +{ + // Instantiate the Excel application object + IApplication application = excelEngine.Excel; + + // Assigns default application version + application.DefaultVersion = ExcelVersion.Xlsx; + + // Create a workbook with 1 worksheet + IWorkbook workbook = application.Workbooks.Create(1); + + // Access first worksheet from the workbook + IWorksheet worksheet = workbook.Worksheets[0]; + + // Adding text to a cell + worksheet.Range["A1"].Text = "Hello World"; + + // Protect the worksheet + worksheet.Protect("syncfusion", ExcelSheetProtection.All); + + // Save the workbook to disk in XLSX format + workbook.SaveAs("Output.xlsx"); +} +{% endhighlight %} + +{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} +Using excelEngine As New ExcelEngine() + ' Instantiate the Excel application object + Dim application As IApplication = excelEngine.Excel + + ' Assigns default application version + application.DefaultVersion = ExcelVersion.Xlsx + + ' Create a workbook with 1 worksheet + Dim workbook As IWorkbook = application.Workbooks.Create(1) + ' Access first worksheet from the workbook + Dim worksheet As IWorksheet = workbook.Worksheets(0) + + ' Adding text to a cell + worksheet("A1").Text = "Hello World" + + ' Protect the worksheet + worksheet.Protect("syncfusion", ExcelSheetProtection.All) + + ' Save the workbook to disk in XLSX format + workbook.SaveAs("Sample.xlsx") +End Using +{% endhighlight %} +{% endtabs %} + + +A complete working example in C# is present on this GitHub page. \ No newline at end of file From 78fb70c05b53243336da1aaa61a36bd0f7dc36b0 Mon Sep 17 00:00:00 2001 From: VinothSF5015 Date: Tue, 5 May 2026 18:01:46 +0530 Subject: [PATCH 2/7] Update title for Excel file read-only guide --- ...n-excel-file-as-readonly-option-in-ms-excel-using-xlsio.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Document-Processing/Excel/Excel-Library/NET/faqs/how-to-open-excel-file-as-readonly-option-in-ms-excel-using-xlsio.md b/Document-Processing/Excel/Excel-Library/NET/faqs/how-to-open-excel-file-as-readonly-option-in-ms-excel-using-xlsio.md index cc1c4f612..d19caa19d 100644 --- a/Document-Processing/Excel/Excel-Library/NET/faqs/how-to-open-excel-file-as-readonly-option-in-ms-excel-using-xlsio.md +++ b/Document-Processing/Excel/Excel-Library/NET/faqs/how-to-open-excel-file-as-readonly-option-in-ms-excel-using-xlsio.md @@ -1,5 +1,5 @@ --- -title: How to open Excel file as ReadOnly in MS Excel using XlsIO? | Syncfusion +title: How to Open an Excel File as Read‑Only Using XlsIO | Syncfusion description: Shows how to set the 'Read-only recommended' flag when saving an Excel workbook with Syncfusion XlsIO so Excel prompts to open it as read-only. platform: document-processing control: XlsIO @@ -91,4 +91,4 @@ End Using {% endtabs %} -A complete working example in C# is present on this GitHub page. \ No newline at end of file +A complete working example in C# is present on this GitHub page. From 9396a26027ec2a301eb7a9b19d419fb121c9e60f Mon Sep 17 00:00:00 2001 From: VinothSF5015 Date: Tue, 5 May 2026 18:03:41 +0530 Subject: [PATCH 3/7] Update link text for Excel ReadOnly FAQ --- Document-Processing-toc.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Document-Processing-toc.html b/Document-Processing-toc.html index 0e88751ea..38a02fff7 100644 --- a/Document-Processing-toc.html +++ b/Document-Processing-toc.html @@ -6773,7 +6773,7 @@ How to merge cells preserving topleft value and format in XlsIO?
  • - How to open Excel file as ReadOnly in MS Excel using XlsIO? + How to open Excel file as ReadOnly in MS Excel using XlsIO?
  • From 1dd1e82c29250586d17713b1c5bdc4244afca46f Mon Sep 17 00:00:00 2001 From: VinothSF5015 Date: Tue, 5 May 2026 18:06:32 +0530 Subject: [PATCH 4/7] Fix link text for ReadOnly Excel file FAQ --- Document-Processing-toc.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Document-Processing-toc.html b/Document-Processing-toc.html index 38a02fff7..56ebc399b 100644 --- a/Document-Processing-toc.html +++ b/Document-Processing-toc.html @@ -6773,7 +6773,7 @@ How to merge cells preserving topleft value and format in XlsIO?
  • - How to open Excel file as ReadOnly in MS Excel using XlsIO? + How to open Excel file as ReadOnly in Microsoft Excel using XlsIO?
  • From 2a2ee1105c3d35f50a5c309af024e5031bbe24ba Mon Sep 17 00:00:00 2001 From: VinothSF5015 Date: Tue, 5 May 2026 18:57:48 +0530 Subject: [PATCH 5/7] 992377 - Added --- Document-Processing-toc.html | 2 +- ...file-as-readonly-option-in-microsoft-excel-using-xlsio.md} | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename Document-Processing/Excel/Excel-Library/NET/faqs/{how-to-open-excel-file-as-readonly-option-in-ms-excel-using-xlsio.md => how-to-open-excel-file-as-readonly-option-in-microsoft-excel-using-xlsio.md} (97%) diff --git a/Document-Processing-toc.html b/Document-Processing-toc.html index 56ebc399b..c1894ca35 100644 --- a/Document-Processing-toc.html +++ b/Document-Processing-toc.html @@ -6773,7 +6773,7 @@ How to merge cells preserving topleft value and format in XlsIO?
  • - How to open Excel file as ReadOnly in Microsoft Excel using XlsIO? + How to open Excel file as ReadOnly in Microsoft Excel using XlsIO?
  • diff --git a/Document-Processing/Excel/Excel-Library/NET/faqs/how-to-open-excel-file-as-readonly-option-in-ms-excel-using-xlsio.md b/Document-Processing/Excel/Excel-Library/NET/faqs/how-to-open-excel-file-as-readonly-option-in-microsoft-excel-using-xlsio.md similarity index 97% rename from Document-Processing/Excel/Excel-Library/NET/faqs/how-to-open-excel-file-as-readonly-option-in-ms-excel-using-xlsio.md rename to Document-Processing/Excel/Excel-Library/NET/faqs/how-to-open-excel-file-as-readonly-option-in-microsoft-excel-using-xlsio.md index d19caa19d..cc1c4f612 100644 --- a/Document-Processing/Excel/Excel-Library/NET/faqs/how-to-open-excel-file-as-readonly-option-in-ms-excel-using-xlsio.md +++ b/Document-Processing/Excel/Excel-Library/NET/faqs/how-to-open-excel-file-as-readonly-option-in-microsoft-excel-using-xlsio.md @@ -1,5 +1,5 @@ --- -title: How to Open an Excel File as Read‑Only Using XlsIO | Syncfusion +title: How to open Excel file as ReadOnly in MS Excel using XlsIO? | Syncfusion description: Shows how to set the 'Read-only recommended' flag when saving an Excel workbook with Syncfusion XlsIO so Excel prompts to open it as read-only. platform: document-processing control: XlsIO @@ -91,4 +91,4 @@ End Using {% endtabs %} -A complete working example in C# is present on this GitHub page. +A complete working example in C# is present on this GitHub page. \ No newline at end of file From cf7d772d964d6a40adff037119b69923aba33a4b Mon Sep 17 00:00:00 2001 From: VinothSF5015 Date: Tue, 5 May 2026 19:46:47 +0530 Subject: [PATCH 6/7] Update title for read-only Excel file documentation --- ...-file-as-readonly-option-in-microsoft-excel-using-xlsio.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Document-Processing/Excel/Excel-Library/NET/faqs/how-to-open-excel-file-as-readonly-option-in-microsoft-excel-using-xlsio.md b/Document-Processing/Excel/Excel-Library/NET/faqs/how-to-open-excel-file-as-readonly-option-in-microsoft-excel-using-xlsio.md index cc1c4f612..0abb7e03c 100644 --- a/Document-Processing/Excel/Excel-Library/NET/faqs/how-to-open-excel-file-as-readonly-option-in-microsoft-excel-using-xlsio.md +++ b/Document-Processing/Excel/Excel-Library/NET/faqs/how-to-open-excel-file-as-readonly-option-in-microsoft-excel-using-xlsio.md @@ -6,7 +6,7 @@ control: XlsIO documentation: UG --- -# How to open Excel file as ReadOnly in MS Excel using XlsIO? +# How to open Excel file as ReadOnly in Microsoft Excel using XlsIO? You can make Excel prompt users to open a workbook as read-only by setting the Read-only recommended flag on the workbook before saving. The example below shows how to set this flag with Syncfusion XlsIO and save the file so Microsoft Excel offers the "Read-only recommended" option when the file is opened. @@ -91,4 +91,4 @@ End Using {% endtabs %} -A complete working example in C# is present on this GitHub page. \ No newline at end of file +A complete working example in C# is present on this GitHub page. From 609d8e6913e5fcd9a4daaff245af0cc53f58ea58 Mon Sep 17 00:00:00 2001 From: VinothSF5015 Date: Tue, 5 May 2026 19:56:15 +0530 Subject: [PATCH 7/7] Update title formatting in Excel file FAQ --- ...el-file-as-readonly-option-in-microsoft-excel-using-xlsio.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Document-Processing/Excel/Excel-Library/NET/faqs/how-to-open-excel-file-as-readonly-option-in-microsoft-excel-using-xlsio.md b/Document-Processing/Excel/Excel-Library/NET/faqs/how-to-open-excel-file-as-readonly-option-in-microsoft-excel-using-xlsio.md index 0abb7e03c..ce1898a04 100644 --- a/Document-Processing/Excel/Excel-Library/NET/faqs/how-to-open-excel-file-as-readonly-option-in-microsoft-excel-using-xlsio.md +++ b/Document-Processing/Excel/Excel-Library/NET/faqs/how-to-open-excel-file-as-readonly-option-in-microsoft-excel-using-xlsio.md @@ -1,5 +1,5 @@ --- -title: How to open Excel file as ReadOnly in MS Excel using XlsIO? | Syncfusion +title: How to Open Excel as Read‑Only using XlsIO | Syncfusion description: Shows how to set the 'Read-only recommended' flag when saving an Excel workbook with Syncfusion XlsIO so Excel prompts to open it as read-only. platform: document-processing control: XlsIO