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

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

GlennUK

Well-known Member
Joined
Jul 8, 2002
Messages
11,723
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

GlennUK

Well-known Member
Joined
Jul 8, 2002
Messages
11,723
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

ukkz001

Board Regular
Joined
Apr 12, 2005
Messages
199
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

GlennUK

Well-known Member
Joined
Jul 8, 2002
Messages
11,723
OK ... have a look at my previous reply ... I altered it after posting to give a solution.
 
Upvote 0

ukkz001

Board Regular
Joined
Apr 12, 2005
Messages
199
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

GlennUK

Well-known Member
Joined
Jul 8, 2002
Messages
11,723
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

ukkz001

Board Regular
Joined
Apr 12, 2005
Messages
199
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,190,794
Messages
5,982,960
Members
439,808
Latest member
agutosay

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
Top