Skip to main content
Version: v6.5.0

Build Data Table from Excel Table

Command Description

Build Data Table from Excel Table

Command Prototype

objDatatable = Datatable.BuildDataTableFromExcel(filePath, sheetName, optionArgs)

Command parameter

parametermandatorytypedefault valueInstructions
filePathTruepath''' C:\Users'''Specify file path, only supports formats such as'. xls', '. xlsx', '. xlsm', '. xlsb', '. odf', '. ods', and'. odt '
sheetNameTruestring"Sheet1"Specify a worksheet in an Excel table. You can fill in the name of the worksheet (such as "Sheet1") or the order value of the worksheet (such as 0), which must be an integer value starting from 0, that is, the order of the first worksheet is 0, the order of the second worksheet is 1, and so on
headerFalsebooleantrueShould the first row of the table be used as the column name for the data table? The default is yes

Return result

ObjDatatable, Assign the result of running the command to this variable.

Run instance

/*********************************Build Data Table from Excel*******************************
Command Prototype:
objDatatable = Datatable.BuildDataTableFromExcel(filePath, sheetName, optionArgs)
Input Parameters:
filePath -- File path. Note: Specify the file path. Only supports formats: '.xls', '.xlsx', '.xlsm', '.xlsb', '.odf', '.ods', '.odt'
sheetName -- Worksheet name. Note: Specify the worksheet in the Excel file. You can fill in the name of the worksheet (e.g., "Sheet1") or the index of the worksheet (e.g., 0). Must be an integer value starting from 0, i.e., the first worksheet has index 0, the second has index 1, and so on.
header -- First row as column names. Note: Whether to use the first row of the sheet as the column names of the data table. Default is yes.
Output Parameter:
objDatatable -- The variable where the output of the function call will be saved.
Notes:
None
********************************************************************************/
Dim objDatatable = ""
objDatatable = Datatable.BuildDataTableFromExcel('''C:\Users''', "Sheet1", {"header":true})
TracePrint(objDatatable)