Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: ArgumentException

...

Exception
System.Exception
System.Exception

If there is a problem creating, opening, or writing to the file specified, or reading from the workbook object.

Exception
System.ArgumentException
System.ArgumentException

If the extension of the filename given is invalid for the given workbook. For example, a file created with Excel 2007, that has macros must be saved with the .xlsm extension

Example
Code Block
csharp
csharp
titleC#

          ExcelApplication oExcelApp = new ExcelApplication();
          Workbook wb = oExcelApp.Create();
          oExcelApp.Save(wb,@"C:\Sales2003\June.xls");
        
Code Block
vb.net
vb.net
titlevb.net

          Dim oExcelApp As New ExcelApplication()
          Dim wb As Workbook = oExcelApp.Create()
          oExcelApp.Save(wb, "C:\Sales2003\June.xls")