ajReadWorkbook function
Description
The ajReadWorkbook function imports the content of an Excel file into a defined area in the Excel worksheet. It is mainly used for loading data from an Excel file for processing.
Syntax
ajReadWorkbook(source_workbook_path, data_range, [convert_to_text], [run_condition], [run_by_function_point_only])
Argument Name | Description |
---|---|
source_workbook_path (required) | Specify the path of the file to be read. Remark: The function only supports source workbook in xlsx and xlsm format and it cannot not be the same as current workbook. |
data_range (required) | Specify the range of data to read in the source workbook in [sheet]!range_address format. For example, "sheet1!A2:F10". |
convert_to_text (optional) | If it equals TRUE, the return result will be converted to string values. If it equals FALSE, the return result will preserve the original data type of each cell. If you do not specify anything, the default value will always be FALSE. |
run_condition (optional) | The function will run when the value is TRUE. Otherwise will not run. If you do not specify anything, the default value will always be TRUE. |
run_by_function_point_only (optional) | If it equals FALSE, the function can be executed through ‘Excel Calculation’ (can be either Automatic or Manual, Calculate Now or Calculate Sheet) or Run Function Point. If it equals TRUE, the function can be executed with Run Function Point (AlchemyJ toolbar \ Run Function Point) only. If you do not specify anything, the default value will always be TRUE. |
The function will return:
1) Content type: Contents of specified data range in the selected file
2) Method: Cell array
Example
Here is an Excel file to be read by ajReadWorkbook function. Data from A1 to E6 is to be read to the AlchemyJ workbook.
Records in the source Excel are loaded to the selected area.