Commands & Syntax > Commands > Excel >

www.perfectkeyboard.com

 

Close workbook - < excel_wb_close >() ... [Pro]

 

Excel: Close workbook
<excel_wb_close>(Workbook identifier,SAVE)
Available in: Professional edition

This command closes a Microsoft ® Excel ® workbook (file) and optionaly saves it.
Note: Microsoft ® and Excel ® are Microsoft Corporation registered trademarks.

 

#

Parameter name

Parameter description

1

Workbook identifier

A workbook identifier previously obtained by "open workbook" command.

2

SAVE

Save workbook:
0 - No
1 - Yes

 

Example (Macro Steps):

 

1

<#> <#>This macro shows how to open and close an Excel workbook

2

Macro execution: ONLY COMMANDS

3

Excel: Open/Create workbook "" (Worksheet = "", Show = "Yes", Workbook identifier = "wbi")

4

Message SHOW "Information" : "A new Excel workbook is open and will be closed now." (other parameters: x = -100, y = -100, Window title = Excel Open/Close, Buttons = OK, Timeout (seconds) = 0, Always on top = No).

5

Excel: Close workbook "%wbi%" (SAVE = "No")

Example (Plain Text):

 

<#>This macro shows how to open and close an Excel workbook

<cmds>

<excel_wb_open>("","",1,wbi)

<msg>(-100,-100,"A new Excel workbook is open and will be closed now.","Excel Open/Close",1,0,0,0)

<excel_wb_close>(%wbi%,0)