XLS Object
 
Syntax
 
XLS.SaveWorkBook [wbName], filename[, FileFormat][, Password][, MakeBackup]
 
Description
Saves the selected workbook.
 
Parameter
Description
wbName
String, optional. Holds the name of the workbook to be stored in file. If omitted or when zero-length string, the active workbook will be stored.
filename
String, required. The full path and name of the file that the selected workbook is stored in.
FileFormat
Enumerated, optional. Can be one of the following values:
xlSaveDefault (this is the default value when omitted)
xlSaveDIF
xlSaveExcel9795
xlSaveHTML
xlSaveWindowsCSV
Password
String, optional. When the file needs to be password protected, this parameter must hold the valid password for the file.
MakeBackup
Boolean, Optional. When True, the save operation in Excel automatically created a backup file of the previous version.
 
See Also
Example
 
Sub Main
 
Dim mySheets() As String
Dim x As Integer
 
   If Not XLS.AppInit() Then Exit Sub
 
   XLS.AppVisible = True
 
   XLS.AddWorkBook
   XLS.AddWorkSheet "Test1"
   XLS.AddWorkSheet "Test2"
   XLS.AddWorkSheet "Test3"
   XLS.AddWorkSheet "Test4"
 
   XLS.SaveWorkBook , "o:\AdminSQL\Scripts\mijntest.xlsx"
 
   XLS.CloseWorkBook , False
 
   XLS.OpenWorkBook "o:\AdminSQL\Scripts\mijntest.xlsx"
 
   XLS.ListWorkSheets mySheets()
 
   For x = 1 To UBound(mySheets)
      Debug.Print mySheets(x)
   Next x
 
   XLS.AppClose
 
End Sub