Skip to main content
Skip table of contents

f$Excel create workbook


f$Excel create workbook

Create a new Excel workbook. The name of the workbook is to be entered inclusive of path. If the path does not exist, the status –2 is returned. The error message from Excel can be obtained with the function: f$Excel(’Error’, ParameterName ). If the workbook already exists, Excel asks if you want to overwrite the existing workbook.

Note that the character "\" must be entered twice ("\\") when entering the path in the file name.

Syntax:

Status = f$Excel('Workbook', 'create', Name ,[password, readonly])

 

Argument

Type

Meaning

 

'Workbook'

String

Keyword

 

'create'

String

Keyword

 

Name

String

Name of the Excel workbook to be created.

 

Password

String

Password required to edit the Excel document (this parameter is optional)

 

Readonly

Integer

1 – this document is created and marked as read-only. (this parameter is optional)

Result:

Integer

0: command executed successfully

Example:

Status = f$Excel('Workbook','create','c:\\temp\\test2.xls')
Status = f$Excel('Sheet', 'open', 'Table2')
Status = f$Excel('Cell', 'set',2,1, '1')
Status = f$Excel('Close',0)

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.