<cfspreadsheet action="read"
src="#application.loadpath#\#Session.NewWorking#"
name="sObj"
SHEET="2" />
<cfscript>
spreadsheetSetCellValue(sObj,#val(RA)#,2,2);
spreadsheetSetCellValue(sObj,#val(AP)#,3,2);
spreadsheetSetCellValue(sObj,#val(GetCHAP.showvalue)#,4,2);
spreadsheetSetCellValue(sObj,#val(GetFP.showvalue)#,5,2);
spreadsheetSetCellValue(sObj,#val(getrad.showvalue)#,6,2);
spreadsheetSetCellValue(sObj,#val(GetClosed.showvalue)#,7,2);
</cfscript>
<cfspreadsheet action="write" overwrite="true"
filename="#application.loadpath#\#Session.NewWorking#"
name="sObj" />
<cfspreadsheet action="read"
src="#application.loadpath#\#Session.NewWorking#"
name="sObj" />
<cfscript>
SpreadsheetSetActiveSheetNumber(sObj, 2);
spreadsheetSetCellValue(sObj,#val(RA)#,2,2);
spreadsheetSetCellValue(sObj,#val(AP)#,3,2);
spreadsheetSetCellValue(sObj,#val(GetCHAP.showvalue)#,4,2);
spreadsheetSetCellValue(sObj,#val(GetFP.showvalue)#,5,2);
spreadsheetSetCellValue(sObj,#val(getrad.showvalue)#,6,2);
spreadsheetSetCellValue(sObj,#val(GetClosed.showvalue)#,7,2);
</cfscript>
<cfspreadsheet action="write" overwrite="true"
filename="#application.loadpath#\#Session.NewWorking#"
name="sObj" />
SpreadsheetSetActiveSheetNumber(sObj, 2);
<cfscript>
sObj = SpreadSheetRead("#application.loadpath#\#Session.NewWorking#","Cap Unit Status");
spreadsheetSetCellValue(sObj,#val(RA)#,2,2);
spreadsheetSetCellValue(sObj,#val(AP)#,3,2);
spreadsheetSetCellValue(sObj,#val(GetCHAP.showvalue)#,4,2);
spreadsheetSetCellValue(sObj,#val(GetFP.showvalue)#,5,2);
spreadsheetSetCellValue(sObj,#val(getrad.showvalue)#,6,2);
spreadsheetSetCellValue(sObj,#val(GetClosed.showvalue)#,7,2);
</cfscript>
<cfspreadsheet action="write" overwrite="true"
filename="#application.loadpath#\#Session.NewWorking#"
name="sObj" />
<cfscript>
inputPath = "c:/path/myFile.xlsx";
outputPath = "c:/path/newFile.xlsx";
sObj = SpreadSheetRead(inputPath);
SpreadsheetSetActiveSheetNumber(sObj, 2);
spreadsheetSetCellValue(sObj,111,2,2);
spreadsheetSetCellValue(sObj,222,3,2);
spreadsheetSetCellValue(sObj,3333,4,2);
</cfscript>
<cfspreadsheet action="write" overwrite="true"
filename="#outputPath#"
name="sObj" />
The first worksheet has graphs on it. But the 2nd one - the one that I am writing to is just two columns of data with some formulas... Is that what is hanging this up now?
Try removing the sheet number from the "read". Then setting the active sheet before adding the values:
<cfspreadsheet action="read" src="#path#" name="sObj" />
<cfset SpreadsheetSetActiveSheetN
... etc....