06-23-2011, 11:13 PM
I create/save/open and work wih an objExcel file in different fuctions. But my usage of it fails. How do I make my objExcel for global usage?
Make my objExcel global
|
06-23-2011, 11:13 PM
I create/save/open and work wih an objExcel file in different fuctions. But my usage of it fails. How do I make my objExcel for global usage?
07-05-2011, 01:39 PM
Either you can define the excel object outside all those functions scope or return the excel object just before the end of function blocks which manipulate on the workbooks
07-06-2011, 12:30 AM
To define my Excel objects outside all of my functions, must I then also pass ObjExcel through them all? Currently, I open my Start Up Script which just alls other functions. Here?
07-06-2011, 08:46 AM
You don't need to pass variables in the global scope (outside functions) as parameters to functions.
You can directly access them in any functions provided they are all in same action script
07-09-2011, 01:36 AM
Raj,
Sorry, but I still dont undertstand completely. Do I need to set obExcel at each function that uses it? If I dont, I get messages indicating that objExcel is not recognized, so I pass objExcel aqnd everything works fine. I Set my objExcel in my test script. I thought if it was set here, my functions could use it. But, when I use objExcel in other associated functions, the objExcel fails. What am I doing incorrectly? thx ;-) Lor
Lorena,
If you are using associated functions obviously you will have to pass it. If you are in same action and it has got its own functions then no need to pass
07-11-2011, 08:53 PM
Im only using one action. After I create an Excelave it, must I close and reopen nit using Set objExcel=O:\QTP Tests\QTPOutputData\DocViewHref.xls?
check if this code template works
Code: 'function library file |
« Next Oldest | Next Newest »
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
Reading Global Sheet's DataTable Value | Bhuvana | 0 | 1,639 |
01-05-2020, 10:03 PM Last Post: Bhuvana |
|
Error as Global Not defined while trying to retrieve value from Datatable | siddharth1609 | 0 | 965 |
09-11-2019, 02:52 PM Last Post: siddharth1609 |
|
How to make QTP Script to work when system gets locked? | ramkumarad | 6 | 12,493 |
11-02-2017, 03:37 PM Last Post: Divv |
|
global object which can be called in any action | excellentpawan123 | 2 | 2,769 |
04-01-2015, 07:34 PM Last Post: babu123 |
|
Local script to make compatible with QC | automation2012 | 1 | 2,304 |
01-28-2015, 02:11 PM Last Post: automation2012 |