View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
KP[_4_] KP[_4_] is offline
external usenet poster
 
Posts: 43
Default Open Word file with Excel VBA

Hi,

I want to open a Word file using an Excel macro, but it doesn't work as I
want.
I get the message: This file is locked for editing by another user....."
It must have something to do with the macro, because the file is not locked
or already open.
How can I avoid this message?

Dim wdApp As Object
Dim wdDoc As Object
Set wdApp = CreateObject("Word.application")
wdApp.Visible = True
Set wdDoc = wdApp.Documents.Open _
(Filename:="C:\Documents and Settings\XXX\Desktop\test.doc")

Regards
Kaj Pedersen