Using VBA to set the Address on a hyperlink

G

Guest

If anyone can help me, I'd be very appreciative!
I am trying to set the address and screentips on hyperlinks from the
contents of an Excel Sheet.

in this case, wbXL is the Excel File. That part works.
But -- If I set the screentip ONLY (no address) or set the screeptip AFTER
the Address, the screentip updates correctly. But if I set the address
afterwards, it clears the screentip. Furthermore, and most importantly -- I
can't get the address to update. The msgboxes that pop up for debugging both
show the updated address correctly -- but it isn't reflected in the UI.

Please help me if you can!! Thanks!!

For Each oSl In ActivePresentation.Slides
For Each oHl In oSl.Hyperlinks
oHl.Address = wbXL.Cells(ctrInt, 1).Value
MsgBox "1" & oHl.Address
oHl.ScreenTip = wbXL.Cells(ctrInt, 2).Value
MsgBox "2" & oHl.Address

ctrInt = ctrInt + 1
Next ' hyperlink
Next ' Slide
 
S

Steve Rindsberg

If anyone can help me, I'd be very appreciative!
I am trying to set the address and screentips on hyperlinks from the
contents of an Excel Sheet.

in this case, wbXL is the Excel File. That part works.
But -- If I set the screentip ONLY (no address) or set the screeptip AFTER
the Address, the screentip updates correctly. But if I set the address
afterwards, it clears the screentip. Furthermore, and most importantly -- I
can't get the address to update. The msgboxes that pop up for debugging both
show the updated address correctly -- but it isn't reflected in the UI.

Please help me if you can!! Thanks!!

For Each oSl In ActivePresentation.Slides
For Each oHl In oSl.Hyperlinks
oHl.Address = wbXL.Cells(ctrInt, 1).Value
MsgBox "1" & oHl.Address
oHl.ScreenTip = wbXL.Cells(ctrInt, 2).Value
MsgBox "2" & oHl.Address

ctrInt = ctrInt + 1
Next ' hyperlink
Next ' Slide

I tried more or less the same thing except w/o the reference to Excel cells,
just using hardcoded strings. Seems to work ok here (PPT 2003, SP2)

Is there anything unusual about the link destinations? Depending on the
situation, PPT will just quietly ignore whatever your code has asked it to do -
no errors raised - if you ask for something impossible.

You can't create image/sound/movie links to files that aren't where the link
points, for example. Not true of hyperlinks, where you can plug in all sorts of
silly stuff and it'll buy it, but there may be *something* it won't eat.

Try hardcoded urls, just to see how it works out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top