Ask Question Forum:
C
O
M
P
U
T
E
R
2
8
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Y-position of the mouse cursor
Attachment:===
Shell command in VBA

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
Use
Shell """C:Program FilesMicrosoft OfficeOFFICE11Excel.exe"" " & datafilename & "", vbNormalFocus
This passes the excel filename as a parameter. Else it is handled as part of the executable.
Use
Shell """C:Program FilesMicrosoft OfficeOFFICE11Excel.exe"" " & datafilename & "", vbNormalFocus
This passes the excel filename as a parameter. Else it is handled as part of the executable.
Use
Shell """C:Program FilesMicrosoft OfficeOFFICE11Excel.exe"" " & datafilename & "", vbNormalFocus
This passes the excel filename as a parameter. Else it is handled as part of the executable.
Use
Shell """C:Program FilesMicrosoft OfficeOFFICE11Excel.exe"" " & datafilename & "", vbNormalFocus
This passes the excel filename as a parameter. Else it is handled as part of the executable.