Macro command GetSheets

<< Click to Display Table of Contents >>

Navigation:  Macros > Macro commands and parameters > Macro reporting commands > Macro write to Excel >

Macro command GetSheets

Purpose:

To retrieve the number of worksheets in aan Excel workbook.

 

General notation:

Getsheets ( FileIndex, number )

 

FileIndex is the same index used by the Open command. Using the Open command a spreadsheet file is assigned to a FileIndex for later Read commands. The FileIndex is an integer number between 1 and 9. If a value of 0 is assigned to the FileIndex, this corresponds to the currently opened output spreadsheet.

 

Example to retrieve the number of worksheets in the standard output workbook (FileIndex 0):

 GetSheets ( 0, N )

 Text'The number of worksheets is: ', N)