MrExcel Publishing
Your One Stop for Excel Tips & Solutions

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?


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

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