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

Built-in dialog show xlChangeLinks 1

Status
Not open for further replies.

GlennUK

MIS
Apr 8, 2002
2,937
GB
Hi all,

I have a user that wants the Change Links dialog to show at the press of a button, but I can't get it to work. This format of code:
Code:
Application.Dialogs(xlDialogChangeLink).Show
works for all kinds of things, but not the Change Link one, I'd imagine it's because you should have to specify the "From" link to get to the dialog. But how to? What's the syntax?

After searching the web for 2 hours for info on this particular built-in dialog, thought I'd ask here. Has anyone done this?

I don't need a workaround, I can see a couple of ways around this. I am curious as to how you get this working.

This is Excel 97 ( I know, I know, soooo outdated. But it's what the client uses. ).

Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
Hi Glenn,
you need to pass a link you like to change as an argument:
Code:
Dim vLinks As Variant
vLinks = ThisWorkbook.LinkSources(xlExcelLinks)
If Not IsEmpty(vLinks) Then
    Application.Dialogs(xlDialogChangeLink).Show vLinks(1)
End If
or a step earlier (I have not found proper dialog enum):
Code:
Application.CommandBars.FindControl(ID:=759).accDoDefaultAction

combo
 
Hi combo,

thanks. I tried that hours ago, with a hard coded link filename .... and it failed, because I had a typo in the filename! Damn, damn, blast.

Thanks to your posting I tried it again, and got it working. So, well worth a star :-D

Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top