S
Sam Hill
Hi all,
I have recently written a complex (for me) program that runs in an
HP-VEE environment, whereas certain Excel macros are called to run as
part of the process. The program is working but I have run into two
difficulties that need to be ironed out, one of which involves Excel
and the other involves VEE.
Problem1:
After the process is complete Excel can still be seen running in the
Task Manager processes table. I will now list several lines of code
from the VEE environment that will hopefully shed some light.
There is a Formula object with the following code:
Set ExcelWkbk=createObject("Excel.Sheet"); // Launch Excel
Set ExcelApp=ExcelWkbk.Application; // Assign the application object
ExcelApp.Visible = FALSE; // Make Excel invisible
ExcelWkbk.Close(); // Close blank wkbk
ExcelApp.Workbooks.Open(xlsFileSpec); // Open file containing macros
ExcelApp.Windows(1).WindowState = xlMaximized;
After myriad processes, there is final Formula object that includes
the following:
ExcelApp.Quit()
I have tried adding the following to the same object:
Set ExcelWkbk = Nothing
Set ExcelApp = Nothing
The problem here is that I get an error message stating VEE does not
recognize "Nothing." I tried adding these same "= Nothing" statements
at the end of the last Excel macro to run. I did not get any errors,
but Excel was still running in Task Manager after the program ran.
Any suggestions?
Problem 2:
I have created the VEE program as a runtime process. I have found
that VEE runtime programs are apparently designed to initiate
automatically upon opening, then close automatically upon completion.
I have gotten around this by starting with an "Until Break" object
which pings a "Confirm" object. Once the user clicks the "Confirm"
object the program runs and then pauses again on Confirm. This worked
fine until I added an "On Cycle" object following Confirm. The
purpose of this is so that the program will run automatically every 30
minutes. This leads to the problem: How to allow a user to STOP the
program, thereby requiring the "Confirm" object to be clicked to
restart it. So far the only way I have found that works is to close
the program and reopen it, once again enabling the "Confirm" object.
There must be some way to do this without having to close the program.
Any suggestions here? I realize this is group for the Excel experts,
but I am hoping there is also some familiarity with VEE. (Maybe
someone could suggest a more appropriate group for VEE-based
questions?)
Any help would be greatly appreciated.
Thank you,
S.
I have recently written a complex (for me) program that runs in an
HP-VEE environment, whereas certain Excel macros are called to run as
part of the process. The program is working but I have run into two
difficulties that need to be ironed out, one of which involves Excel
and the other involves VEE.
Problem1:
After the process is complete Excel can still be seen running in the
Task Manager processes table. I will now list several lines of code
from the VEE environment that will hopefully shed some light.
There is a Formula object with the following code:
Set ExcelWkbk=createObject("Excel.Sheet"); // Launch Excel
Set ExcelApp=ExcelWkbk.Application; // Assign the application object
ExcelApp.Visible = FALSE; // Make Excel invisible
ExcelWkbk.Close(); // Close blank wkbk
ExcelApp.Workbooks.Open(xlsFileSpec); // Open file containing macros
ExcelApp.Windows(1).WindowState = xlMaximized;
After myriad processes, there is final Formula object that includes
the following:
ExcelApp.Quit()
I have tried adding the following to the same object:
Set ExcelWkbk = Nothing
Set ExcelApp = Nothing
The problem here is that I get an error message stating VEE does not
recognize "Nothing." I tried adding these same "= Nothing" statements
at the end of the last Excel macro to run. I did not get any errors,
but Excel was still running in Task Manager after the program ran.
Any suggestions?
Problem 2:
I have created the VEE program as a runtime process. I have found
that VEE runtime programs are apparently designed to initiate
automatically upon opening, then close automatically upon completion.
I have gotten around this by starting with an "Until Break" object
which pings a "Confirm" object. Once the user clicks the "Confirm"
object the program runs and then pauses again on Confirm. This worked
fine until I added an "On Cycle" object following Confirm. The
purpose of this is so that the program will run automatically every 30
minutes. This leads to the problem: How to allow a user to STOP the
program, thereby requiring the "Confirm" object to be clicked to
restart it. So far the only way I have found that works is to close
the program and reopen it, once again enabling the "Confirm" object.
There must be some way to do this without having to close the program.
Any suggestions here? I realize this is group for the Excel experts,
but I am hoping there is also some familiarity with VEE. (Maybe
someone could suggest a more appropriate group for VEE-based
questions?)
Any help would be greatly appreciated.
Thank you,
S.