R
Robert Christie
Hi everyone
I found a previous post which said a MSWord document
could be opened and viewed by clicking a Command button
in Excel.
The post had this comment included, which I don't think I
fully understand.
"Assuming winword.exe is in your path statement, if not,
just include the full path statement to winword.exe."
I've included the original code plus code I've modified
to suit my folder location, names etc.
On running my code I receive an error 53 and the last
line is highlighted "Shell myApp........"
I've checked the Spelling, Paths and Capital case
characters.
Have I included the Path Statement correctly.?
Should it be on a seperate line?
Post Code
Private Sub CommandButton1_Click()
Dim myApp As String, myDoc As String
myApp = "winword.exe"
myDoc = """" & "C:\My Documents\myword.doc" & """"
Shell myApp & myDoc, vbMaximizedFocus
End Sub
My code.
Private Sub Open_Excel_Help()
Dim myApp As String, myDoc As String
myApp = "C:\Program Files\Microsoft
Office\Office10\WINWORD.EXE"
myDoc = """" & "C:\DATA\Word\EXCEL HELP.doc"
& """"
Shell myApp & myDoc, vbMaximizedFocus
End Sub
TIA
Bob Christie
I found a previous post which said a MSWord document
could be opened and viewed by clicking a Command button
in Excel.
The post had this comment included, which I don't think I
fully understand.
"Assuming winword.exe is in your path statement, if not,
just include the full path statement to winword.exe."
I've included the original code plus code I've modified
to suit my folder location, names etc.
On running my code I receive an error 53 and the last
line is highlighted "Shell myApp........"
I've checked the Spelling, Paths and Capital case
characters.
Have I included the Path Statement correctly.?
Should it be on a seperate line?
Post Code
Private Sub CommandButton1_Click()
Dim myApp As String, myDoc As String
myApp = "winword.exe"
myDoc = """" & "C:\My Documents\myword.doc" & """"
Shell myApp & myDoc, vbMaximizedFocus
End Sub
My code.
Private Sub Open_Excel_Help()
Dim myApp As String, myDoc As String
myApp = "C:\Program Files\Microsoft
Office\Office10\WINWORD.EXE"
myDoc = """" & "C:\DATA\Word\EXCEL HELP.doc"
& """"
Shell myApp & myDoc, vbMaximizedFocus
End Sub
TIA
Bob Christie