Hi All,
I am creating excel charts for my application…I am creating pivot tables and charts .So i have to use more than one sheet.
Set excelApp = CreateObject(“Excel.Application”)
excelApp.SheetsInNewWorkbook = 1
call excelApp.Workbooks.Add
'Code to add data to first sheet
I am activating second sheet using following code
excelApp.Workbooks(1).Worksheets(1).Activate
excelApp.Workbooks(1).Worksheets(1).Name= “PivotSheet”
in my system it is creating second sheet …but it is not working in users system.
is it due to excel setting or error in my coding?
i have used
excelApp.Workbooks(1).Worksheets(“Sheet2”).Activate
excelApp.Workbooks(1).Worksheets(“Sheet2”).Name= “PivotSheet”
Same is also not working always.
How i can write code to activate sheet successfully irrespective of users excel sheet setting?