Locked for editing

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

Guest

I wrote the program in excel. It opens a word.doc for reading from a
userform. This works fine running from a usb drive. All files on usb were
copied from my hard drive. each file was copied indivually to usb drive. All
files on my drive are in one folder.
Question when run from my drive says word.doc is locked for editing. On usb
goes right to word.doc
I am missing something.
Any one have any ideas from your help I have got project complete with only
this left to solve.
Thanks much to All who post answers you are invaluable
Thanks Again
 
No I dont believe so. Checked properties on USB shows archive for intro.doc
Here is the code that opens the file. I use this same code on other files
also.
Thanks for looking it is a question that bugs me.

Sub intro()
Dim Word As New Word.Application
Dim WordDoc As New Word.Document
Word.Visible = True
Set WordDoc = Word.Documents.Open("C:\parade\intro.doc")
End Sub
 
Try changing
Dim WordDoc As New Word.Document

to
Dim WordDoc As Word.Document

Opening your file will create the object.

Tim
 
Back
Top