SaveMultiSheetExcel Method

The SaveMultiSheetExcel method saves some or all of the open worksheets to a single Excel XLSX document.

Syntax

object.SaveMultiSheetExcel( fileName, wksToInclude )

 

Parameter Type Description
fileName String Path and file name including the extension for the saved file.
wksToInclude Variant Array of strings specifying the worksheets to save.

 

Example

The following example opens three worksheets, then saves the worksheets to a single Excel file.

Sub Main

'Open existing worksheets

Set Wks1 = Grapher.Documents.Open("C:\Program Files\Golden Software\Grapher\Samples\3D bar chart.dat","")

Set Wks2 = Grapher.Documents.Open("C:\Program Files\Golden Software\Grapher\Samples\3D histogram.dat","")

Set Wks3 = Grapher.Documents.Open("C:\Program Files\Golden Software\Grapher\Samples\Floating bar chart.xls","Sheet=""Sheet1""")

 

'Create the arrays of worksheets to export

Dim Array1(2) As String

Array1(0) = Wks1.Name

Array1(1) = "Floating bar chart.xls"

Array1(2) = "3D histogram.dat"

 

'Create multi-sheet Excel file

Grapher.Documents.SaveMultiSheetExcel("C:\myDocs\multisheet.xlsx", Array1)

End Sub

 

Used by: Documents Collection