EXCELTOBUF

Concept Link IconSee also Concept Link IconExample

Create a memory buffer from an Excel file in XLSX format.

WebVue support - Yes.

Syntax

LongVal = EXCELTOBUF (WorkbookPath, SheetName, LineSeparator, ColumnSeparator [, RangeFirstRow, RangeFirstColumn, RangeLastRow, RangeLastColumn]);

Argument

Meaning

WorkbookPath

The path and/or the name of the workbook. If you do not supply a path, PcVue will assume the workbook is in the project's TP folder. Type STR.
If executed in a WebVue session context this instruction is processed by the computer that hosts the web back end and the file must exist on that computer.

SheetName The name of the worksheet. Maximum 30 characters. Type STR
LineSeperator The character to be used as a line separator in the buffer (one character such as ‘;’ or ‘\n’). Type STR.
ColumnSeperator The character to be used as the column separator in the buffer (one character such as ‘,’ or ‘\t’). Type STR.
RangeFirstRow First row of read range in Excel sheet (starting from 1).
RangeFirstColumn First column of read range in Excel sheet (Starting from 1)
RangeLastRow Last row of read range in Excel sheet (Starting from 1)
RangeLastColumn Last column of read range in Excel sheet (Starting from 1)

If the optional range parameters are used, all four must be included.

Execution

Action

Create a memory buffer from an Excel file in XLSX format. Maximum buffer size is 128KB.
Return: Handle of memory buffer if OK, otherwise 0.

It is unnecessary to use the ALLOC_BUFFER instruction prior to using EXCELTOBUF as the buffer space is automatically allocated, but FREE_BUFFER must be used to free the buffer space once it is no longer required to keep it in memory.