Forum Discussion
3 Replies
Sort By
- shankar_rCommunity Hero
- kbhaskarOccasional Contributor
scenario
for example there is workbook with three sheets orders,product id's and users, here i need to get or set data to sheet of product id's and i know activesheet but the product id's sheet is inactive.
thanks for replying
- shankar_rCommunity Hero
You can customize below code to get your scenario covered.
function WriteData() { var excelObject = Sys.OleObject("Excel.Application"); excelObject.Visible = false; excelObject.DisplayAlerts = false; var excelWorkbookObj = excelObject.Workbooks.Open(strexcelFileName); var excelMainSheet = excelWorkbookObj.Sheets.Item("<Sheet Name want to Write>"); excelMainSheet.Range("A1").Value = "S.No"; excelMainSheet.Range("B1").Value = "Module Name" excelWorkbookObj.Save(); excelWorkbookObj.Close(); excelObject.Visible = true; excelObject.DisplayAlerts = true; excelObject.Quit() //CleaningUp excelObject = null; excelWorkbookObj = null; excelMainSheet = null; }
Related Content
Recent Discussions
- 10 hours agovladd1