VBA code to open the edit links option box

lavoo

New Member
Joined
Jul 14, 2016
Messages
9
Does anyone know how to write a simple VBA code to open the edit links option box under data - connections? I wish to have this code run and the edit links box pops over for user to select their option.

Any help would be great! Thanks!
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
It's the option under Excel --> Data --> Connections --> Edit Links, then a box pops up with "Change Source, Update Values etc. " options.
 
Upvote 0
i have never use that function before. are you familiar with marco recoder? you can record the macro when manually edit the link. then stop the recoder and edit the code. you may need to create a user form to facilitate the editing
 
Upvote 0
it works for me. when i add a new connection. the recorded code is
Code:
    Workbooks("Book1").Connections.AddFromFile _
        "C:\Program Files\Microsoft Office\Office14\QUERIES\MSN MoneyCentral Investor Currency Rates.iqy"
and the code to change the connection is
Code:
    With ActiveWorkbook.Connections("MSN MoneyCentral Investor Currency Rates")
        .Name = "MSN MoneyCentral Investor Currency Rates"
        .Description = ""
    End With
    ActiveWorkbook.Connections("MSN MoneyCentral Investor Currency Rates").Refresh
 
Last edited:
Upvote 0
There are existing multiple connections built in the file. Objective is remind users to update the various connected files by "changing" their source (rather than refreshing connections).
Therefore the names of the existing connections is not constant.

I tried using

Sheets("Edit Links").Select
Application.Dialogs(xlDialogChangeLink).Show ActiveWorkbook.LinkSources(xlExcelLinks)(1)

But this led me straight to the change source window, instead of the window prior to that (edit links), where I can choose which external file to change from.
 
Upvote 0
First of all thanks for your recommendation, Mike.
Tried that but error message pops up indicating "class of dialog failed".

In addition, my objective is to show the Edit Link pop up box (which allows user to select any existing external linked file to change source),
instead of going straight to the select the name source file.

Any other suggestion perhaps?
 
Upvote 0

Forum statistics

Threads
1,215,636
Messages
6,125,961
Members
449,276
Latest member
surendra75

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top