06-13-2015, 02:06 AM
Hi ,
Is there a way to access the MS Excel controls through QTP.
I want to refresh the Data in the Excel sheet and I tried to use the below code but in vain.
But this code throws "General run Error"
Please share your knowledge.
Is there a way to access the MS Excel controls through QTP.
I want to refresh the Data in the Excel sheet and I tried to use the below code but in vain.
Code:
set xlo = createobject("Excel.Application")
Set xlbook = xlo.Workbooks.Open("XXXX")
xlo.Visible = true
Set xlsheet = xlbook.Worksheets(1)
xlo.CommandBars("Worksheet Menu Bar").Controls(7).controls(14).execute
Controls(7) - > Data tab in Ribbon
Controls(14)-> Refresh option
But this code throws "General run Error"
Please share your knowledge.