In my application I have the option to export data grid values to excel. Once I export to excel I am trying to access data in excel with following code.
JavaWindow("MRS Desktop - QA").JavaTable("Tolerance, $").ClickCell 1,"^CUSIP","RIGHT"
JavaWindow("MRS Desktop - QA").JavaMenu("label:=Open with Excel").Select
Set objExcel = GetObject(, "Excel.Application")
Set objWorkbook = objExcel.Workbooks(1)
Set objWorksheet = objWorkbook.Worksheets(1)
colCnt = objWorksheet.UsedRange.Columns.Count
Here I am getting Run Error(ActiveX component can't create object: 'GetObject')
My code is working when I click "Retry" button on "Run Error" dialogbox.
Why I am getting run error first time. Can anybody help me on this.
Is your file getting launched in excel only or not? Can you see the Excel.exe process in Task Manager?
Buy the NEW QTP Descriptive Programming Unplugged Book
** Download QTP Unplugged 2nd Edition eBook for FREE **
My file is launching as excel file and I found "Excel.exe" process in Task manager.
you have already added 10 sec for sync, when that is removed and when Retry is selected on the error does your code still work ?
-- Here to Learn and share ---