Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello
I am trying to open a WORD document from within an EXCEL macro, which I manage to do successfully, however, sometimes it prompts me the following message File "destination.doc" is locked for editing by Michael Do you want to (a) Open a Read only Copy (b) Create a local copy and merge your changes later (c) Receive notification when the original is available When this message appears (which seems to be intermitantly) I would like hte excel macro to automatically select option a. How do I do this? I am opening the doc with the following line in the excel macro Set wordApp = CreateObject("Word.Application") wordApp.Documents.Open ("c:\Temp\destination.doc") |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
My bet is that while you were testing, you opened the document in a hidden
instance of MSWord. You could use this to see if the file is open before you start: http://support.microsoft.com?kbid=138621 Microsoft's IsFileOpen function. Depending on what version of Windows you're using, you might be able to kill that hidden instance of MSWord. Alt-ctrl-delete task manager (maybe) processes (look for winword.exe) I used a .vbs script when I was testing your other post: dim myWord On Error Resume Next Set myWord = GetObject(, "Word.Application") If Err.Number = 429 Then msgbox "Word is not running" else myWord.visible = true end If On Error GoTo 0 Set myWord = nothing === Just copy into notepad and save it as Unhide.vbs Then you can double click (in windows explorer) to unhide any instances (and there could be several). Unhide, close, unhide, close, etc until you run out of them. kaiser wrote: Hello I am trying to open a WORD document from within an EXCEL macro, which I manage to do successfully, however, sometimes it prompts me the following message File "destination.doc" is locked for editing by Michael Do you want to (a) Open a Read only Copy (b) Create a local copy and merge your changes later (c) Receive notification when the original is available When this message appears (which seems to be intermitantly) I would like hte excel macro to automatically select option a. How do I do this? I am opening the doc with the following line in the excel macro Set wordApp = CreateObject("Word.Application") wordApp.Documents.Open ("c:\Temp\destination.doc") -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Locked worksheet & hyperlinks (w/ select locked cells unchecked) | Excel Discussion (Misc queries) | |||
keyboard is locked after starting in both word and excel | Excel Discussion (Misc queries) | |||
Put comments on a locked spreadsheet even though cells not locked | Excel Worksheet Functions | |||
I want the macros to be locked up when cells are locked up. | Excel Programming | |||
Excel / Word 2002 LOCKED | Excel Programming |