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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Link Excel with Word

Status
Not open for further replies.

tuxalot

Technical User
Sep 5, 2002
34
US
I need to be able to click on a link (word doc) in excel and have Word launch, and open the linked file. These links would ideally be visible in a userform, with the ability to be clicked.

Other options for the WORD link in Excel would include doing the following, all from within Excel:

- Copying it
- Deleting it
- Printing it
- Hiding it

I'm sure I'll think of other things to do with the link, but this should get me well on my way to figuring it out.

Any help is MUCH appreciated.

Skywaz
 
Hiya,

Will something like this do?

1. Add userform to Word Document
2. Add Labels to your userform
3. Add code to the OnClick event of each label to do what you want to do (just doubleclick on your label to get to the VBA Code window for this event).
4. Change font color/style to Blue/Underline if you want for link-like looks ;-)

Some code to launch Excel & workbook (which you'd add to the OnClick event (set a reference to Excel in your Word Doc: goto VBA editor, choose TOOLS>REFERENCES, scroll down to Microsoft Word x.0 Object Model & activate):
Code:
Dim l_appExcel As Excel.Application
Dim l_wkbWorkbook As Workbook


Set l_appExcel = CreateObject("Excel.Application")
Set l_wkbWorkbook = l_appExcel.Workbooks.Open("Path&FileName here")
'Use this if you need your users to see Excel 
l_appExcel.Visible = True

' ...code here if needed

'Release objects if needed - this'll allow the excel app you launched to stay around.
'If you need for it to close, use l_appExcel.Quit firts
Set l_wkbWorkbook = Nothing
Set l_appExcel = Nothing

HTH - if you need/want more info let us know

Cheers!
Nikki
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top