I want to add data to excel sheet using C# program. I am able to add and save data only when excel sheet which i am giving input to the program is closed.
But if i opened the excel sheet which i am giving input to the program before executing the program, the data which i am adding is not saved.
the code i am using is
workbook = appExl.Workbooks.Open(Excel_file, 0,false, 5, “”, “”, false, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, “”, true, false, 0, true, false, false);
and after adding data i am using workbook.Save(); method.
can anyone help me how to save data even the excel sheet is opened?
I think you have locked processes, so you can not save, what you do at first you delete your process by hand.
Then you add these lines of code to have your resources.
and you retested