How do you open excel application
You may use WITH ....ENDWITH to modify properties.
#DEFINE xlMinimized -4140
#DEFINE xlMaximized -4137
loExcel.WindowState = xlMinimized
loExcel.WindowState = xlMaximized
loExcel.Caption = 'My New caption'
loExcel.Width =
loExcel.Height =
If you are wanting to close the ".xls" file use oExcel.ActiveWorkbook.close(). There are optional parameters you can use to prevent prompting the user to save the XLS if changes were made.
I prefer to close the workbooks before calling quit to prevent prompts asking to save changes, incase a change was made and not already saved.
Also, when you are done with the oExcel object and have issued the oExcel.quit() command, Excel continues to run until you store a new value to oExcel (oExcel = .null.) or release oExcel.
You would need to slightly change your approach. Instead of a local loExcel variable you would need to use form's property oExcel. This way you would be able to control Excel instance everythere within form.
Another approach would be to use Event Handler.
Naomi Nosonovsky wrote:
Another approach would be to use Event Handler.
This is not an option in VFP version 6 ( which MM Roy has twice stated that this is the version he is using ).
The EVENTHANDLER() function and the IMPLEMENTS keyword of the DEFINE CLASS command were not added to the language until version 7.
MarciaAkins wrote:
Naomi Nosonovsky wrote:
Another approach would be to use Event Handler.
This is not an option in VFP version 6 ( which MM Roy has twice stated that this is the version he is using ).
The EVENTHANDLER() function and the IMPLEMENTS keyword of the DEFINE CLASS command were not added to the language until version 7.
Good point. So, only the first approach would be a valid option. Or upgrade