View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tim Williams Tim Williams is offline
external usenet poster
 
Posts: 1,588
Default Error message when opening a .doc file using excel macro

Set wordApp = CreateObject("Word.Application")
wordApp.Visible = True

--
Tim Williams
Palo Alto, CA


"GainesvilleWes via OfficeKB.com" <u32072@uwe wrote in message news:6f38f9987ede1@uwe...
Morning,
I have created a macro in excel that when the user clicks a "done" button a
word document is opened from a shared drive.
this is what i have so far:

------------------------------------
Dim x As String
Dim wordApp As Object

ThisWorkbook.Save

x = Range("A156")

Set wordApp = CreateObject("Word.Application")
wordApp.Documents.Open "\\Flcscsrv02\share\Mercury Transactions\Test Docs\
" & x & "\Test word document.doc"
------------------------------------

when i run the macro the first time, nothing happens. when i run it a second
time, i get the "File in Use" pop up.

Where am i going wrong here?

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200703/1