Forum Discussion
shankar_r
9 years agoCommunity Hero
Hi,
You want to edit your Read-Only file, there are no in-build function to change the File Access from Read-Only to write mode.(reference)
However, you can save this file as new workbook and edit all over there and replace it.
Steps to do it:
1) Open you excel workbook as you are having code var book = app.Workbooks.Open(fileName);
2) Save As current workbook to new workbook as like below
excelWorkbookObj.SaveAs(strexcelFileName);
excelWorkbookObj.Close();
excelWorkbookObj = null;
3) Open a new workbook which you saved then edit your changes and Save it.
4) Replace with the existing file.