简体   繁体   中英

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

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

... 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....

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM