Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
Can .xlsm be saved as .xlsx ?

When attempting to do this (with SetCurrentFormat(WorkbookFormat.Excel2007),

I get the error "The workbook contains data which would exceed the limits imposed by the specified format."

Expected behavior would be to allow the change in format (just prior to a Save), but strip Macros.  This is what Excel would do.  How can I save what was a Macro spreadsheet without macros?

  • 5655
    Offline posted


    Thank you for posting. The 65536 limit is a limit of Excel. A single Excel worksheet cannot have more rows than that.
    I believe this limit has been raised in Excel2007 format due to macros, which you can remove by using the ‘ClearVbaData’ method .

    The ClearVbaData’ method would remove any vba parts which i believe should handle the macros

    Regarding the expected behavior - we don't implicitly lose information. so the fact that it throws an error when changing from one format to another is correct. having an overload or alternate method for changing the format and try to address any format errors would be a feature request.

    Let me know if you have any question.

    Divya Jain