excelListSheets

Version 23.4.8839


excelListSheets


Lists the worksheets in a specified Excel workbook.

Optional Parameters

  • version: The Excel version of the target workbook. The allowed values are AUTO, 95, 97-2003, 2007. The default is AUTO.
  • file: The full path on disk, including the filename, of the Excel workbook. You must specify either the file or handle parameter.
  • handle: A readable handle reference to the Excel data created by excelOpen. If you specify the file parameter, handle is not required.

Output Attributes

  • sheet: The name of the current sheet in the target workbook.
  • ishidden: A boolean (true/false) indicating whether the current sheet is hidden in the workbook.

Example

In this example, the sheets of the target Excel workbook are listed and added to a file which is then pushed as output of the script.

<!-- Initializing the output item of the script -->
<arc:set attr="output.data" />
<!-- Creating the input item for the operation and passing it in -->
<arc:set attr="excel.file" value="C:\Temp\movies.xlsx" />
<arc:set attr="excel.version" value="2007" />
<arc:call op="excelListSheets" in="excel" out="sheets">
  <!-- Creating some output data and file from the sheet names in the workbook -->
  <arc:set attr="output.data" value="[output.data]\nSheet = [sheets.sheet] | Hidden = [sheets.ishidden]" />
  <arc:set attr="output.filename" value="results.txt" />
</arc:call>
<!-- Push the output item out as a file -->
<arc:push item="output" />

The output of this script looks like this:

Sheet = music | Hidden = false
Sheet = tvshows | Hidden = true
Sheet = film | Hidden = false