error 5174 file could not be found

C

Curt

The file to open was sent to me as a rich text I saved it as a word.doc.
properties show this ok. Yet excel will not find file. Have both yearly &
yearlya in same folder (parade) It opens yearly fine but doesn't finf
yearlya? Copied yearly code then added a as needed. Following is my code. I
dont see what I did

Private Sub optionbutton35_Click()
OptionButton35.Value = False
Dim Word As New Word.Application
Dim WordDoc As Word.Document
Word.Visible = True
Set WordDoc = Word.Documents.Open("\parade\yearly.doc")
End Sub
-----------------------------
Private Sub optionbutton36_Click()
OptionButton36.Value = False
Dim Word As New Word.Application
Dim WordDoc As Word.Document
Word.Visible = True
Set WordDoc = Word.Documents.Open("\parade\yearlya.doc")
End Sub
 
J

JLGWhiz

When all else fails, check the obvious. See if it is in the folder with a
..doc file extension. For that matter, see if it is in the folder at all.
There does not appear to be anything wrong with the code you posted.
 
C

Curt

Have put on .doc and removed both files are in same folder. when checking
properties it give a diff location however it open yearly fine.
Will keep trying will be something to find out what.
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top