Library.ImportXLSAsSpreadsheet
This function imports an Excel worksheet into a Statistica Spreadsheet.
Syntax | Parameters | Return Value |
---|---|---|
Function Library.ImportXLSAsSpreadsheet( _ fileName As String, _ sheetNumber As Integer, _ Optional bCaseNamesFromFirstColumn As Boolean = False, _ Optional bVariableNamesFromFirstRow As Boolean = False, _ Optional bIncludeFormatting As Boolean = False, _ Optional firstRow As Long = 1, _ Optional lastRow As Long = -1, _ Optional firstColumn As Long = 1, _ Optional lastColumn As Long = -1) As Spreadsheet |
The fully-qualified pathway to the text file to import. Type: String Which worksheet to import. Type: Integer Whether or not to import the first column as the case names. This parameter defaults to False. Type: Boolean Default value: False Whether or not to import the first row as the variable names. This parameter defaults to False. Type: Boolean Default value: False Whether or not to import cell formatting. This parameter defaults to False. Type: Boolean Default value: False The beginning of the range of rows to import. This parameter defaults to 1. Type: Long Default value: 1 The end of the range of rows to import. This parameter defaults to -1, which implies that you wish to import all of the cases. Type: Long Default value: -1 The beginning of the range of columns to import. This parameter defaults to 1. Type: Long Default value: 1 The end of the range of columns to import. This parameter defaults to -1, which implies that you wish to import all of the variables. Type: Long Default value: -1 |
Spreadsheet |
SVB Example
Importing an Excel file as a spreadsheet:
Option Base 1 Option Explicit Sub Main Dim s1 As Spreadsheet 'assigns s1 to the imported spreadsheet 'opens the XLS weather report.xls Set s1 = Application.ImportXLSAsSpreadsheet(Path & _ "\examples\datasets\weather report.xls", _ 1,True,True,True,1,-1,1,-1) 'sets the spreadsheet to visible s1.Visible = True End Sub