G
Guest
I have a form set up with a command button that I want to run an external
program, then run a macro to import the data that is generated by the
program. The code I have for the command button is as follows:
Private Sub cmdAddProducts_Click()
On Error GoTo Err_cmdAddProducts_Click
Dim stAppName As String
Dim stDocName As String
stAppName = "C:\WebPageGen\AddProducts.exe"
Call Shell(stAppName, 1)
stDocName = "ImportProducts"
DoCmd.RunMacro stDocName
Exit_cmdAddProducts_Click:
Exit Sub
Err_cmdAddProducts_Click:
MsgBox Err.Description
Resume Exit_cmdAddProducts_Click
End Sub
For some reason, the external VB program runs fine, but the macro doesn't
run. I know the macro is good, it runs by itself. I've tried programming the
macro into a separate command button, and that works fine. I don't want to
have to use two separate buttons, I want to run both the program and the
macro with one button press. Can anyone suggest why the above code won't work?
program, then run a macro to import the data that is generated by the
program. The code I have for the command button is as follows:
Private Sub cmdAddProducts_Click()
On Error GoTo Err_cmdAddProducts_Click
Dim stAppName As String
Dim stDocName As String
stAppName = "C:\WebPageGen\AddProducts.exe"
Call Shell(stAppName, 1)
stDocName = "ImportProducts"
DoCmd.RunMacro stDocName
Exit_cmdAddProducts_Click:
Exit Sub
Err_cmdAddProducts_Click:
MsgBox Err.Description
Resume Exit_cmdAddProducts_Click
End Sub
For some reason, the external VB program runs fine, but the macro doesn't
run. I know the macro is good, it runs by itself. I've tried programming the
macro into a separate command button, and that works fine. I don't want to
have to use two separate buttons, I want to run both the program and the
macro with one button press. Can anyone suggest why the above code won't work?