View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Walter Briscoe Walter Briscoe is offline
external usenet poster
 
Posts: 279
Default Open Word file with Excel VBA

In message
s.com of Sun, 25 Sep 2011 22:50:12 in microsoft.public.excel.programmin
g, Javed writes
The code worked for me.I think you have opened the file
programmatically earlier and not closed.It will not be visible.
Try to close the file containg macro .reopen the file and try once.


I roughly agree. The OP might reboot the system to start with a known
position and see if the problem disappears.

There seems to be a lack of facilities in Office to tidy up
automatically after Office opens another application.
One can easily get orphan applications which are hidden.
e.g. With code (untested) like:
CreateObject("Word.application").Documents.Open(Fi lename:=foo)

I expect there is a hidden instance of Word locking "C:\Documents and
Settings\XXX\Desktop\test.doc". On my Vista system running Office 2003,
I would open the Task Manager, after right-clicking on an empty part of
the Taskbar, and looking for WINWORD.EXE in the processes tab. "End
Process" with confirmation should zap the problem.

The OP does not say which version of Office or operating system shows
the problem.
--
Walter Briscoe