none
How to adjust the line? RRS feed

  • Question

  • Hi,
    I want to ensure the Excel file created is the version higher than Office 2003. How to adjust this line?

    workbook.SaveAs(@"c:\AB_Position_List\" + cd + ".xls", Excel.XlFileFormat.xlExcel8, misValue, misValue, misValue, misValue, Excel.XlSaveAsAccessMode.xlExclusive, misValue, misValue, misValue, misValue, misValue);



    Many Thanks & Best Regards, Hua Min


    Wednesday, April 29, 2015 10:48 AM

Answers

  • Try:

    workbook.SaveAs(@"c:\AB_Position_List\" + cd + ".xlsm", Excel.XlFileFormat.xlOpenXMLWorkbookMacroEnabled, misValue, misValue, misValue, misValue, Excel.XlSaveAsAccessMode.xlExclusive, misValue, misValue, misValue, misValue, misValue);

    or

    workbook.SaveAs(@"c:\AB_Position_List\" + cd + ".xlsx", Excel.XlFileFormat.xlOpenXMLWorkbook, misValue, misValue, misValue, misValue, Excel.XlSaveAsAccessMode.xlExclusive, misValue, misValue, misValue, misValue, misValue);

    Wednesday, April 29, 2015 2:23 PM