Link to home
Start Free TrialLog in
Avatar of hoikar
hoikar

asked on

C# + Late Binding (Excel) - Save File

I have tried to update excel using C# and late and message prompt when program excuting the "Save" function

objBook.GetType().InvokeMember("SaveAs", BindingFlags.InvokeMethod, null, objBook, Parameters);

may I know is there any method to disable this alert? or make allow autosave?

Thanks
Avatar of Rakesh_Desai
Rakesh_Desai

You need to set DisplayAlerts property of your Excel object as False, and it will suppress the alert.
Suppose your declared excel object is objExcel then code would be

objExcel.DisplayAlerts = false;

Avatar of hoikar

ASKER

To Rakesh_Desai:

How to set in C# with the late binding?
Could you please provide me one example?

Many Thanks~
ASKER CERTIFIED SOLUTION
Avatar of Rakesh_Desai
Rakesh_Desai

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial