#1   Report Post  
Posted to microsoft.public.excel.misc
Prohock
 
Posts: n/a
Default help with macro

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?
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default help with macro

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.

Prohock wrote:

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?


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search, Copy, Paste Macro in Excel [email protected] Excel Worksheet Functions 0 January 3rd 06 06:51 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
macro with F9 Kenny Excel Discussion (Misc queries) 1 August 3rd 05 02:41 PM
Make Alignment options under format cells available as shortcut dforrest Excel Discussion (Misc queries) 1 July 14th 05 10:58 PM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"