VBA problem with using relative cell offset value in change link function

nymark

New Member
Joined
Apr 19, 2020
Messages
9
Office Version
  1. 2010
I am trying to write a simple macro that will change the file link path/name from the active cell to the value in the cell directly to the right of it....

I tried this:
Dim new_ss As String

ActiveSheet.Calculate

new_ss = ActiveCell.Offset(0, 1).Value

ActiveWorkbook.ChangeLink Range(ActiveCell()), _
Range("new_ss"), xlExcelLinks

But its not working. I know the problem is in the change link to file name variable....

The macro works when I use the names of the two cells.... but I make it realtive to which ever cell lin the SS I am on....

I also tried without the new_ss viable and just using the activecell.offset function in the changelink command...

What am I missing?

Thanks
 
Too bad, I am not familiar with "old fashion" links ...
 
Upvote 0

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.

Forum statistics

Threads
1,214,385
Messages
6,119,208
Members
448,874
Latest member
b1step2far

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