Forum Discussion
shankar_r
Community Hero
Hi,
- You don't really need to have Delay between Creating object and opening an excel workbook
- You can switch between sheets using WorkBook.Sheets.Item("<Sheet name>");
For Ex:
I have modified your code
function WriteExcel(Record) { var Excel,row, column, x,sheetObj,wrkbookObj; x=Record+1; Excel = Sys.OleObject("Excel.Application"); //Delay (3000); wrkbookObj = Excel.Workbooks.Open("C:\\Users\\...DATA TABLE IDs.xls"); sheetObj = wrkbookObj.Sheets.Item("Sheet1"); sheetObj.Cells.Item(x,1).Value=Record; sheetObj.Cells.Item(x,2).Value=ProjectSuite.Variables.VAR1; sheetObj = wrkbookObj.Sheets.Item("Sheet2"); sheetObj.Cells.Item(x,6).Value=aqDateTime.Today(); wrkbookObj.Save(); Excel.Quit(); }
CS
7 years agoNew Contributor
Thanks Shankar!
Related Content
- 8 months agoEgg
- 5 years agobatilmoore
- 9 years agoSudhakarVE
Recent Discussions
- 2 days agovladd1