Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read-only Word doc is "undefined" in its own VBA

Status
Not open for further replies.

groleau

Programmer
Apr 12, 2006
110
US
I needed to make some changes to some old tools, so I put the entire directory
in SourceSafe. This makes all the files read-only. Access and Excel, of course,
work by modifying their own files, so I immediately check them out again.

However, there was a Word file with VBA that only modifies other files, so I left it
checked in. VBA halted with an "object undefined" on the command to reactivate
the tool's window.

Code:
'            Windows(this_doc_name).Activate
In this case, the line was "playing safe" but wasn't really needed. Not sure what you would do if you actually needed to put focus back in that window.

I think I'll convert this tool to .Net only because it's a really simple thing that I can get some practice on.

--
Wes Groleau
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top