Top
PowerCOBOL V11.0 Reference
FUJITSU Software

5.84 SaveAsBook Method

Description:

Executes the Excel save as command to save the book.

Used in controls:

ExcelConnection

Used in objects:

None.

Parameters:

1. VT_BSTR - BookNameX(8192)
2. [VT_BOOL - DisplayDialogS9(4) COMP-5]

3. [VT_BSTR - FileFilterX(8192)]

Description of Parameters:

  1. BookName: The name to use when saving the book.

  2. DisplayDialog: Specify whether to display the Save As dialog.

    POW-TRUE: Display the Save As dialog.

    POW-FALSE: Do not display the Save As dialog.

    If omitted, the Save As dialog is displayed.

  3. Specify the file filter to specify the candidate of the file.

    This specification is displayed in the [Save as type] list of the [Save As] dialog box of Excel. The file filter delimits by the comma and specifies the pair of the description and the extension as follows.

    "Excel book(*.xlsx),*.xlsx"

    If omitted, the file filter is set as follows by the use of the extension of the file specified for BookName. The extension is converted into the small letter.

    "(*.extension),*.extention"

Return value:

VT_I4 - ReturnValueS9(9) COMP-5

Zero or greater indicates normal completion. Negative indicates an error.

Example:

WORKING-STORAGE SECTION.
01 ExcelBookName  PIC X(20).
01 ReturnValue    PIC S9(9) COMP-5.
PROCEDURE DIVISION.
* Saves the current Excel book as 
*  "my.xls" 
    MOVE "C:\my.xls" TO ExcelBookName
    INVOKE CmExcel1 "SaveAsBook" USING ExcelBookName
                             RETURNING ReturnValue

Backward compatibility
method name:

None.