Asked by duncanb7
at 2024-08-06 08:48:23
Point:500 Replies:5 POST_ID:828365USER_ID:11059
Topic:
Microsoft Excel Spreadsheet Software;Miscellaneous Programming;Visual Basic Programming
Could Shell command in VBA run the file with module ? I test it before it seems
only work on the file not on file with module call. My sub could not pass it , please
advise and help . S_main is module in newexecl.xls.
The error report from VBA is "can't find such file"
Sub test()
Dim wkdir As String
Dim datafilename As String
Application.ScreenUpdating = False
wkdir = ActiveWorkbook.Path
datafilename = wkdir & "ewexcel.xls!S_main"
Debug.Print datafilename
Shell "C:Program FilesMicrosoft OfficeOFFICE11Excel.exe " & datafilename,
vbNormalFocus
End
only work on the file not on file with module call. My sub could not pass it , please
advise and help . S_main is module in newexecl.xls.
The error report from VBA is "can't find such file"
Sub test()
Dim wkdir As String
Dim datafilename As String
Application.ScreenUpdating = False
wkdir = ActiveWorkbook.Path
datafilename = wkdir & "ewexcel.xls!S_main"
Debug.Print datafilename
Shell "C:Program FilesMicrosoft OfficeOFFICE11Excel.exe " & datafilename,
vbNormalFocus
End