find doc

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dim WRDAPP, WRDDOC
Set WRDAPP = CreateObject("Word.Application")
Set WRDDOC = WRDAPP.Documents.Open("A:\card.doc")
Knowing file is in location. Why do I get cannot find?
Have tried many examples with no luck
Want to build a macro that will open a word doc (card.doc)
If can find start can adjust. Just not good as starter. Old dog learning new
tricks.
 
Curt,
Your code work if the file exist, otherwise err.number=5174.

You sure the A drive (floppy ?) is accessible and has that file name present
?

You can add a
WRDAPP.Visible = True
to see what word is doing/showing.

NickHK
 
It looked at A and gave same error try a diff name etc
What I want to acomplish is open this file to edit so can cut and paste back
into excel for sorting. I am useing 2000 if that has any bearing.
 
still getting same error? Made a new file to be sure same results. Yes file
is there don't know where to go next
 
last shot my full code error still cannot find file
Sub word()

Dim WRDAPP, WRDDOC
Set WRDAPP = CreateObject("Word.Application")
Set WRDDOC = WRDAPP.Documents.Open("A:\desc.DOC")
'Or for a new doc:
Set WRDDOC = WRDAPP.Documents.Add

WRDAPP.Visible = True
WRDAPP.Quit

End Sub
 
Curt,
Yes, that's what I get for wrong filename/path.
Sure the filename's correct ?
And you have permission to read that folder ?

NickHK
 

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

Back
Top