Data Link Issue

Simont485

Board Regular
Joined
May 19, 2018
Messages
50
HI all

I have setup vba code to get comments from another workbook. It works fine until I close down all workbooks and reopen.

Then then link has changed from

=GetComments('[EPN - SPN - ROTA 1st April 2019 to 1st April 2020.xlsx]Rota 2019-20'!J35)

to

=GetComments('\\Ukpnforfs01\1$\Power Networks\Asset Management\NETWORK_OPS\NET_CNTRL\Control Room Rota\EPN SPN Control Room Rotas\[EPN - SPN - ROTA 1st April 2019 to 1st April 2020.xlsx]Rota 2019-20'!J35)

and the links are corrupted! I then have to re-make the links


VBA code
Function GetComments(pRng As Range) As String
'Updateby20140509
If Not pRng.Comment Is Nothing Then
GetComments = pRng.Comment.Text
End If
End Function

Bothe workbooks are stored the same file location
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
the links are not corrupted - they will work flawlessly without re-working them while the two workbooks are opened at the same time.

When the second Wb is opened the formula only contains it's name (it all that's needed at this point) and you can fetch the range properties.
When you close the second wb the links change to store its actual location. Which is perfectly normal. But at this point you cannot get to the range.
Think of it as a room inside a house - you can't enter the room without entering the house.
well you can sort of, but it's slightly more complicated.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,155
Members
453,021
Latest member
Justyna P

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