Programmatic saving of an existing excel file
-
I want to use C# to save the changes made to an existing excel file. The path of the excel file is fixed and it can be assumed that the file is opened in an excel window from before. All I want to do is write a program that periodically saves whatever changes were made to the file (in the excel window) since it was last saved. I have tried sending the Ctrl-S windows message to excel and also tried playing around the Microsoft.Office.Interop.Excel namespace, but to no avail. Is there a way to do this that anyone is aware of? I am using Office 2007 but a solution for Office 2003 or 2002 will also be of help to me. -- Nikhil
-
I want to use C# to save the changes made to an existing excel file. The path of the excel file is fixed and it can be assumed that the file is opened in an excel window from before. All I want to do is write a program that periodically saves whatever changes were made to the file (in the excel window) since it was last saved. I have tried sending the Ctrl-S windows message to excel and also tried playing around the Microsoft.Office.Interop.Excel namespace, but to no avail. Is there a way to do this that anyone is aware of? I am using Office 2007 but a solution for Office 2003 or 2002 will also be of help to me. -- Nikhil
When the Excel is opened then you have to attach your application to existing Excel process. The Save method works for me.
-
When the Excel is opened then you have to attach your application to existing Excel process. The Save method works for me.
Can you write some sample code to attach an object of Microsoft.Office.Interop.Excel.Application to an already existing excel.exe application?