weaselmcguff
Board Regular
- Joined
- Feb 24, 2006
- Messages
- 245
I have a userform that searches for a particular file. At the moment it is pulling up Excel and Word Files from a predefined directory.
I am trying to figure out how to load the file that they select. selecting the file I have figured out. This is the code I am trying to use for Word atm.
Private Sub shipopen_Click()
Dim newApp As Object
Set newApp = CreateObject("word.application")
newApp.Application.Visible = True
newApp.Documents.Open Filename:=ship3
End Sub
the ship3 is the actual full location of the file where it is listed at
ie. c:\mydocuments\user2\document1.doc
i am getting a Run Time Error 13. Type Mismatch.
Any help? or suggestion.
Also need to do the same for an excel file.
Thanks
I am trying to figure out how to load the file that they select. selecting the file I have figured out. This is the code I am trying to use for Word atm.
Private Sub shipopen_Click()
Dim newApp As Object
Set newApp = CreateObject("word.application")
newApp.Application.Visible = True
newApp.Documents.Open Filename:=ship3
End Sub
the ship3 is the actual full location of the file where it is listed at
ie. c:\mydocuments\user2\document1.doc
i am getting a Run Time Error 13. Type Mismatch.
Any help? or suggestion.
Also need to do the same for an excel file.
Thanks