Did you set the Read-Only property to true when you open the book?
Refer to the instructions on how to open a book with write access:
Microsoft.Office.Interop.Excel.Application xlApp = null; Microsoft.Office.Interop.Excel.Workbook xlWorkBook = null; xlApp = new Excel.ApplicationClass(); xlWorkBook = xlApp.Workbooks.Open(txtFilePath.Text, 0, false, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
A false value for the 3rd parameter of the xlApp.Workbooks.Open method means that the book will not be read-only.
This is just a wild hunch, since you have not shared any code on how you open the book. Hope this helps.
source share