Run time error - Excel object - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming) +--- Thread: Run time error - Excel object (/Thread-Run-time-error-Excel-object) |
Run time error - Excel object - sasi1982 - 11-03-2010 Hi, I have a simple code where it creates excel object and add data to it. But i am getting the below run time error when i execute it. Can some please check and let me know solution. run time error : ActiveX component can't create object: 'Excel.Application' Thanks in advance. RE: Run time error - Excel object - KavitaPriyaCR - 11-03-2010 Is statement like: CreateObject("Excel.Application") RE: Run time error - Excel object - sasi1982 - 11-03-2010 Yes kavitha. With that statement only i am getting the runtime error. Kavitha, if i run the piece of code individually from QTP, it is working fine. But, if add the funtion definition to the .vbs file and then call it from QTP, it is not working. .vbs is associated to the script. Can you please reply back immediately if you have solution. Thanks .. RE: Run time error - Excel object - A.Saini - 11-03-2010 HI Sasi, I think you should double check whether the function is properly called from the Script. You can use the "Alt+G" to check that. RE: Run time error - Excel object - sasi1982 - 11-03-2010 Hi saini, i have checked it. it is fine. RE: Run time error - Excel object - KavitaPriyaCR - 11-03-2010 Hi Sasi please check my code, i tried to simulate your error. 1. Function definition: Code: Public Function ReadExcel() 2. Associate .vbs file in settings >> resources 3. Main script in QTP: Code: Call ReadExcel() This is working fine for me. can you please check, is it the way you are trying to do? OR am i understanding it other way? RE: Run time error - Excel object - sasi1982 - 11-03-2010 Kavitha, Thank you so much for the reply. Here probably, the problem is , when i run the script in the invisible mode, then it is throwing this error. But if i run the script from QTP UI, it is not working. I am copying the code here for your reference. Please have a look. Code: public Function Export_Result(TestID,Driver_Script,Res,Comments) Thanks Sasi.C RE: Run time error - Excel object - KavitaPriyaCR - 11-03-2010 Hi sasi I tried your code it self.It is working fine for bothe the cases mentioned below: 1. When i run the script from QTP UI. 2. when i run the script in the invisible mode (after replacing the parameters with data). |