J
jqq
I have some working code that I'm trying to move to class modules (my
first try at classes). The code opens an Excel workbook, activates a
worksheet, collects some information from the worksheet, loops through
cells and uses the values in the calling program, then closes the
workbook. Windows XP, Excel 2003 (reference library Excel 11), WRQ
Reflections 11. I'm running terminal emulation scripts in Reflections
that need to call values from Excel. All of this code works as
subs/functions in a regular module.
I've set up a class module for the Excel code, created properties, and
created separate methods for Open/Activate, GetInfo, and Close. I need
to call the Open/Activate and then GetInfo methods, run the scripts
(pulling values from Excel), and then Close the workbook. Everything
runs fine the first time through, but on subsequent runs, I lose the
App/Wkbk/Wksht objects on the step after the first method call and get
"object required" errors thereafter. This problem remains until I
completely close and reopen Reflections.
The same problem happens when running the code from Access, so it's not
just a Reflections problem.
Can anyone give me a clue as to where my problem might lie? I'm not
sure which pieces of code you might need to see, please let me know &
I'll c&p it in.
Thanks very much for any suggestions!
first try at classes). The code opens an Excel workbook, activates a
worksheet, collects some information from the worksheet, loops through
cells and uses the values in the calling program, then closes the
workbook. Windows XP, Excel 2003 (reference library Excel 11), WRQ
Reflections 11. I'm running terminal emulation scripts in Reflections
that need to call values from Excel. All of this code works as
subs/functions in a regular module.
I've set up a class module for the Excel code, created properties, and
created separate methods for Open/Activate, GetInfo, and Close. I need
to call the Open/Activate and then GetInfo methods, run the scripts
(pulling values from Excel), and then Close the workbook. Everything
runs fine the first time through, but on subsequent runs, I lose the
App/Wkbk/Wksht objects on the step after the first method call and get
"object required" errors thereafter. This problem remains until I
completely close and reopen Reflections.
The same problem happens when running the code from Access, so it's not
just a Reflections problem.
Can anyone give me a clue as to where my problem might lie? I'm not
sure which pieces of code you might need to see, please let me know &
I'll c&p it in.
Thanks very much for any suggestions!