Total newbie grovels for help...
(I'm a Cold Fusion programmer using a custom tag to do this, I have no experience w/ COM objects)
I'm looking for a Method Library for Excel, I've scoured the Microsoft site and can't find what I want, (or don't know what I'm looking for). I'm trying to modify this code to Set the pagesetup to print on a single page
A co-worker tried to implement this but did not work: objWorkSheet.PageSetup.FitToPagesTall = 1;
objWorkSheet.PageSetup.FitToPagesWide = 1;:
Here is the full code:
// open Excel in the background
objExcel.Visible = false;
// disable Alerts such as: 'Save this workbook?'
objExcel.DisplayAlerts =false;
// Define the workbooks object
objWorkBook = objExcel.Workbooks;
// open the Excel file */
objOpenedBook = objWorkBook.Open(HTMLFilePath);
// get the WorkSheets collection
objWorkSheets = objExcel.WorkSheets;
// get the active worksheet - will have the same name as the HTML file
objWorkSheet = objWorkSheets.Item(HTMLFileName);
objWorkSheet.Name = Attributes.SheetName;
// Save As does not work with workbooks / only with worksheets
objWorkSheet.SaveAs(ExcelFilePath,Val(1));
// Close the document
objWorkBook.Close();
if(Attributes.LeaveOpen IS "No"{
// Quit Excel
objExcel.Quit();
}
//release the object
objExcel = "Nothing";
(I'm a Cold Fusion programmer using a custom tag to do this, I have no experience w/ COM objects)
I'm looking for a Method Library for Excel, I've scoured the Microsoft site and can't find what I want, (or don't know what I'm looking for). I'm trying to modify this code to Set the pagesetup to print on a single page
A co-worker tried to implement this but did not work: objWorkSheet.PageSetup.FitToPagesTall = 1;
objWorkSheet.PageSetup.FitToPagesWide = 1;:
Here is the full code:
// open Excel in the background
objExcel.Visible = false;
// disable Alerts such as: 'Save this workbook?'
objExcel.DisplayAlerts =false;
// Define the workbooks object
objWorkBook = objExcel.Workbooks;
// open the Excel file */
objOpenedBook = objWorkBook.Open(HTMLFilePath);
// get the WorkSheets collection
objWorkSheets = objExcel.WorkSheets;
// get the active worksheet - will have the same name as the HTML file
objWorkSheet = objWorkSheets.Item(HTMLFileName);
objWorkSheet.Name = Attributes.SheetName;
// Save As does not work with workbooks / only with worksheets
objWorkSheet.SaveAs(ExcelFilePath,Val(1));
// Close the document
objWorkBook.Close();
if(Attributes.LeaveOpen IS "No"{
// Quit Excel
objExcel.Quit();
}
//release the object
objExcel = "Nothing";