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

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
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,223,527
Messages
6,172,836
Members
452,483
Latest member
Johnstone

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