SARATH
SARATH

Reputation: 49

Backward compatibility using excel interop in C#

I am using an excel interop to open an excel file, edit and save it with some other name in some other location. For that I have used:

workbook.saveAs(newFileName)

But it is prompting in the application for compatibility like how it is used to prompt while saving .xls file in office 2007. I have to click on continue in the front end application in order to continue. How can it be resolved?

Thanks in advance, Sarath

Upvotes: 1

Views: 947

Answers (2)

John Bustos
John Bustos

Reputation: 19574

... I'm not sure I 100% understand what it is you're experiencing, but if it's a notification box that appears, try putting this line before the Save command:

ExcelApp.DisplayAlerts = False

That should disable the alert from popping up....

Upvotes: 0

Jay
Jay

Reputation: 57979

There is an Application.DisplayAlerts property which you can set to False during your SaveAs operation (and then set back to True).

Here are the details: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel._application.displayalerts(v=office.11).aspx

Upvotes: 1

Related Questions