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

spreadsheetRenameSheet

Last update:
May 18, 2026

Description

Renames a sheet in a spreadsheet.xf

Returns

None

History

  • ColdFusion (2025 release): Added the function.

Syntax

SpreadsheetRenameSheet( Object spreadsheet, String oldName, String newName)

Parameters

Name
Required
Type
Description
spreadSheetObject
Yes
ExcelInfo
The Excel spreadsheet object where a sheet must be renamed.
oldName
Yes
String
The sheet to be renamed.
newName
Yes
String
The new name of the sheet.

Example

<cfscript>
    // set the path of the file
    theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "art-source.xls";
    // create the spreadsheet naming the first worksheet as Course
    obj =SpreadsheetNew("Course")
    // create the second worksheet
    SpreadsheetCreateSheet (obj,"Marks");
    // create the third worksheet
    SpreadsheetCreateSheet (obj,"EvaluationSheet");
    spreadsheetWrite(obj, "#theFile#", "", "yes", "no")
    obj1 =SpreadsheetRead(#theFile#)
    spreadsheetRenameSheet(obj1,"Marks","MarksRenamed")
    writeDump(obj1)
    writeOutput(obj1.SUMMARYINFO.SHEETNAMES)
</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