Micro Focus QTP (UFT) Forums
How to Save an Active Excel WorkBook using VbScript in QTP - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: How to Save an Active Excel WorkBook using VbScript in QTP (/Thread-How-to-Save-an-Active-Excel-WorkBook-using-VbScript-in-QTP)



How to Save an Active Excel WorkBook using VbScript in QTP - shilupg - 06-04-2014

Hi Ankur,

In my application I need to save an excel report from a web page.When click on the excel file link , a Pop up window with Open, Savexcel file and Cancel will appear.
Here I have two options to save the file to the local directory

1) Using the Save and give the path, but when give the path through the VBscript and click on the Save button, its not getting saved, The file name passed through VBscript to the filename textbox is not accepting
2) in the second option, after opening I have the below VbScript to save the file , But its not working during run mode,an Error is showing "Object required". Its working when I am Debugging the same step in QTp.

Code:
oExcelApp = GetObject(,"excel.application")
    wait(25)
oExcelApp.ActiveWorkBook.SaveAs "C:\xExel.xls"
oExcelApp.Application.Quit

Please help me to get a solution for this issue