how to disable compatibility check in excel while automating through c#

后端 未结 3 817
一生所求
一生所求 2020-12-16 21:51

I am using Excel 2007 interop assembly to automate Excel through c#. Interop version is 12.0. When I try to save a file, it can be saved only in 2003 format, but thats fine

相关标签:
3条回答
  • 2020-12-16 22:35

    Try instead workbook.CheckCompatibility = false;

    0 讨论(0)
  • 2020-12-16 22:41

    I used the following in bold to make it skip the compatibility issue.

    ActiveWorkbook.SaveAs Filename:= filepath or filename .xls" _ , FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False

    0 讨论(0)
  • 2020-12-16 22:47

    Try ThisWorkBook.DoNotPromptForConvert = true

    More info at DoNotPromptForConvert

    0 讨论(0)
提交回复
热议问题