Change Link Source Prompt

ukkz001

Board Regular
Joined
Apr 12, 2005
Messages
199
Is there a way to write a macro to bring up the "change link source" input box so the user does not have to click: Data>Edit Links>Change Source?

In addtiton to that, can the "change source" window default to a specified directory path?

Thanks,
Kevin
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
I'm sure that I've done this in the past ... I'll have a look for the dialog id and how to display it today ( unless someone else out there knows right now of course ).
 
Upvote 0
One more question ... will this be for choosing a link from the list, or will there only be one link in the workbook?

Actually this would do multi or single:
Code:
Sub linktest()
    ChDrive "W"             ' set the current Drive letter - CHANGE AS REQUIRED
    ChDir "\Applications"   ' set the working directory    - CHANGE AS REQUIRED
    alink = ThisWorkbook.LinkSources
    If IsEmpty(alink) Then
        MsgBox "No links found"
    ElseIf UBound(alink) = 1 Then
        Application.Dialogs(xlDialogChangeLink).Show alink(1), "", 1
    Else
        Application.Dialogs(xlDialogOpenLinks).Show
    End If
End Sub
 
Last edited:
Upvote 0
It will be for the user to click the Change Source button and browse out on our network to choose the source.

Thanks,
Kevin
 
Upvote 0
OK ... have a look at my previous reply ... I altered it after posting to give a solution.
 
Upvote 0
most of the code is working however, when the dialog box appears and I select the file to update the Source Links, the program hangs and becomes unresponsive and I have to kill the Excel process.

I think it is doing this because it leaves the the prior link source and then essentially there are two link sources and it doesn't know what to do with them.
 
Upvote 0
How many links do you think you are starting off with?

Are they normal Excel files that are linked?

Which dialog is shown when you run the code?
 
Upvote 0
Nevermind the Source File I was selecting during the macro testing was locked for editing by another user.

Thanks so much for your time, you helped me out big time.

Cheers,
Kevin
 
Upvote 0

Forum statistics

Threads
1,214,645
Messages
6,120,711
Members
448,984
Latest member
foxpro

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