LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Word Doc locked for ediiting

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
 
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
Locked worksheet & hyperlinks (w/ select locked cells unchecked) dgold82 Excel Discussion (Misc queries) 1 July 10th 09 09:42 PM
keyboard is locked after starting in both word and excel kfaul Excel Discussion (Misc queries) 0 November 18th 08 03:48 PM
Put comments on a locked spreadsheet even though cells not locked RDP Excel Worksheet Functions 1 September 11th 05 11:59 PM
I want the macros to be locked up when cells are locked up. Ed Excel Programming 6 February 20th 05 01:31 AM
Excel / Word 2002 LOCKED Simon[_9_] Excel Programming 0 April 1st 04 09:00 AM


All times are GMT +1. The time now is 01:42 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"