User Guide Cancel

SpreadsheetInfo

 

Note:

You can find the CFFiddle demo of this function and other spreadsheet functions as part of a project that is shared with you.

Click the button below to launch CFFiddle.

To copy the project in your workspace in CFFiddle, follow the steps below:

  1. Log in with your Gmail or Facebook credentials.
  2. Navigate to the project in the left pane.
  3. Once you make some changes in any cfm in the project, a pop up displays asking you to save the project.
  4. Give the project a suitable name and click Save.

Description

Gets the property of an Excel spreadsheet object.

Returns

Returns a spreadsheet property that can be one of the following:

  • AUTHOR
  • CATEGORY
  • COMMENTS
  • CREATIONDATE
  • LASTEDITED
  • LASTAUTHOR
  • LASTSAVED
  • KEYWORDS
  • MANAGER
  • COMPANY
  • SUBJECT
  • TITLE
  • SHEETS
  • SHEETNAMES
  • SPREADSHEETTYPES

Category

Microsoft Office Integration

Function syntax

SpreadsheetInfo(spreadsheetobj)

See also

SpreadsheetAddColumnSpreadsheetAddImageSpreadsheetAddRowSpreadsheetDeleteRow

SpreadsheetDeleteRowsSpreadsheetFormatRowSpreadsheetFormatRowsSpreadsheetShiftRows

History

  • ColdFusion (2025 release): Returns the visibility of a sheet. The visibility information is represented as struct. View example for more information. There are three types of visibility settings:
    • Visible: The sheet is visible.
    • Hidden: The sheet is hidden but can be made visible through the UI.
    • Very Hidden: The sheet is hidden and cannot be made visible through the UI.
  • ColdFusion 9: Added the function.

Parameters

Parameter

Description

spreadsheetobj

The Excel spreadsheet object from which to get the value.

Usage

This function is supported by Microsoft Office Excel 2007 and Microsoft Office 2003.

Example

<cfspreadsheet action="read" src="#dirname#SingleSheet.xls" name="SpreadsheetObj" >
<cfset info = SpreadSheetInfo(SpreadsheetObj)>
<cfoutput> AUTHOR : #info.author#<br> </cfoutput>
<cfoutput> Creation Date : #info.creationdate#<br> </cfoutput>
<cfoutput> LAST AUTHOR : #info.lastauthor#<br> </cfoutput>
<cfoutput> SHEETS : #info.sheets#<br> </cfoutput>
<cfoutput> SPREADSHEETTYPE : #info.SPREADSHEETTYPE#<br> </cfoutput>
<cfoutput>SUBJECT : #info.SUBJECT#<br></cfoutput>
<cfoutput>TITLE : #info.TITLE#<br></cfoutput>

Example- sheet visibility

The struct Visibility contains a struct with the following values:

  • VISIBLE
  • HIDDEN
  • VERY_HIDDEN

This feature can be useful when you want to hide certain data or calculations from the end-user but still need them for internal use or computations.

<cfscript>
outputExcelFilePath = "#expandpath('./')#excelWithHiddenSheets.xlsx"
cfspreadsheet(action="read", src=outputExcelFilePath, name="ssob");
ssinfo = spreadsheetInfo(ssob)
writeOutput("Sheet visibility information" & "<br/>")
writeDump(ssinfo.visibility)
</cfscript>
<cfscript> outputExcelFilePath = "#expandpath('./')#excelWithHiddenSheets.xlsx" cfspreadsheet(action="read", src=outputExcelFilePath, name="ssob"); ssinfo = spreadsheetInfo(ssob) writeOutput("Sheet visibility information" & "<br/>") writeDump(ssinfo.visibility) </cfscript>
<cfscript>
    outputExcelFilePath = "#expandpath('./')#excelWithHiddenSheets.xlsx"
    cfspreadsheet(action="read", src=outputExcelFilePath, name="ssob");
    ssinfo = spreadsheetInfo(ssob)
    writeOutput("Sheet visibility information" & "<br/>")
    writeDump(ssinfo.visibility)
</cfscript>

Output

View sheet visibility
View sheet visibility

Get help faster and easier

New user?