Archive of Mr Excel Message Board

Back to Hyperlinks in Excel archive index
Back to archive home

Open Word Document based on cell contents
Posted by Rick on January 30, 2002 11:17 AM
How do you open a specific Word document based on the contents of a cell. For instance: if A1=1 then open abc.doc, if A1=2, then open def.doc?

Re: Open Word Document based on cell contents
Posted by Larry on January 30, 2002 12:05 PM
***** Entering a number to represent a word document doesn't sound like the most dynamic solution. Here is something simple:
Insert a hyperlink leading directly to the document you want opened.
CTRL K or Insert -- Hypelink

Re: Open Word Document based on cell contents
Posted by Jack in the UK on January 30, 2002 3:10 PM
Hi--
This can be done via VBA of cause and trigger from A1 and A2 any combination, need to creat object for word to open and set up target range.
Only my opinion, not pretty, and ive tried many times it painful and many error handels are needed and so it goes on.
As suggested Ctrl+K (hyps) will do just fine rename the hyp to sensible name not full extention and they work just fine .
IF IF IF you really must triger on an event say A1 contains formula =if(A2=30 Jan 02,Macro Run, 0)
And event A1 to trigger if =NOW() then yes i could do this for you but the word object is tricky, ie location, it can never move or be renamed, else CRASH!
Let me know...
Rdgs
JACK in the UK
BTW Though... very messy and not a way i would walk.
HTH

This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our
online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.