AccessShell
Board Regular
- Joined
- Sep 5, 2015
- Messages
- 52
- Office Version
- 2003 or older
- Platform
- Windows
NOTE: Originally posed elsewhere. I do not believe I will get an answer.
I hope I can post it here.
I have written some code in Sub Workbook_Open. It works fine. However, I am trying to do two more things.
1. I don't know if I should use Workbook_BeforeClose, Workbook_Deactivate, or Workbook_BeforeSave. I am trying to Shell to a VB6 program and exit the worksheet. All three subroutines activate the three sub-routines mentioned above.
Here is an example of what I tried
"
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim MD as String
MD = Shell("C:\My VB6 Executables\Data Display\DataDisplay.exe", 1)
end
End Sub
"
In addition, when I tried two of the three (BeforeClose and Deactivate), the shell command just kept repeating until I ran out of memory. Or, maybe the routine kept repeating
2. In the Workbook_open routine I need to place some code to gracefully close the VB6 program that I shelled to in the close of this Excel spreadsheet.
Thanks
I hope I can post it here.
I have written some code in Sub Workbook_Open. It works fine. However, I am trying to do two more things.
1. I don't know if I should use Workbook_BeforeClose, Workbook_Deactivate, or Workbook_BeforeSave. I am trying to Shell to a VB6 program and exit the worksheet. All three subroutines activate the three sub-routines mentioned above.
Here is an example of what I tried
"
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim MD as String
MD = Shell("C:\My VB6 Executables\Data Display\DataDisplay.exe", 1)
end
End Sub
"
In addition, when I tried two of the three (BeforeClose and Deactivate), the shell command just kept repeating until I ran out of memory. Or, maybe the routine kept repeating
2. In the Workbook_open routine I need to place some code to gracefully close the VB6 program that I shelled to in the close of this Excel spreadsheet.
Thanks