Whatever message this page gives is out now! Go check it out!

spreadsheetGetCellFormat

Last update:
May 18, 2026

Description

Retrieves the format of a specified cell in a spreadsheet.

Returns

A struct with the following keys:
  • alignment
  • bgcolor
  • bold
  • bottomborder
  • bottombordercolor
  • dataformat
  • fgcolor
  • fillpattern
  • font
  • fontsize
  • indent
  • italic
  • leftborder
  • leftbordercolor
  • rightborder
  • rightbordercolor
  • rotation
  • strikeout
  • topborder
  • topbordercolor
  • textwrap
  • underlineverticalalignment

History

  • ColdFusion (2025 release): Added the function.

Syntax

spreadsheetGetCellFormat(spreadsheetObject,row,column)

Parameters

Name
Required
Type
Description
spreadSheetObject
Yes
ExcelInfo
The Excel spreadsheet object for which to get the cell format.
row
Yes
Integer
The row number of the cell.
column
Yes
Integer
The column number of the cell.

Example

<cfquery name="art" datasource="cfartgallery">
    SELECT * FROM ART
</cfquery>
<cfscript>
    theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "art.xls";
    // create a spreadsheet object
    theSheet=spreadsheetNew("SampleData")
    // add rows from query
    spreadsheetAddRows(theSheet,art)
   // writeOutput(theFile)
    
    // Define the structure for formatting a cell
    myFormat=StructNew();
        myFormat.color="blue";
        myFormat.bold="true";
        myFormat.underline="true";
        myFormat.alignment="center";
        myFormat.rotation=45;
        myFormat.italic="true"
    // Set formatting to cell (10,5)
    SpreadsheetFormatCell(theSheet,myFormat,11,5)
    spreadsheetWrite(theSheet,theFile,"yes")
    // get cell format
    cellFormat=spreadsheetGetCellFormat(theSheet,11,5)
    writeDump(cellFormat)
</cfscript>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page