help with macro

G

Guest

I am using the following macro in excel to open a specific word document that
the excel file merges records into.

Dim wdApp As Object
Dim wdDoc As Object
Set wdApp = CreateObject("Word.application")
Set wdDoc = wdApp.Documents.Open _
(Filename:="B:\test\test.doc")

The file loads in word but I get a message stating that the test.doc is read
only. I don't get the error message if I open the test.doc as per normal. How
can I change my macro so the document loads without being read only?
 
D

Dave Peterson

I'd guess that you have a hidden instance of MSWord running.

I'd reboot the pc and try the code one more time.

And I'd add:

wdApp.visible = true

right after the createobject line.

It might make testing easier.
 

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

Top