ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   error 5174 file could not be found (https://www.excelbanter.com/excel-programming/401631-error-5174-file-could-not-found.html)

Curt

error 5174 file could not be found
 
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

JLGWhiz

error 5174 file could not be found
 
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.

"Curt" wrote:

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


Curt

error 5174 file could not be found
 
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

"JLGWhiz" wrote:

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.

"Curt" wrote:

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



All times are GMT +1. The time now is 12:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com