Links for filepaths too long (+260) fix?

Alejandro Gombao

New Member
Joined
Dec 21, 2022
Messages
6
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2013
  6. 2010
  7. 2007
Platform
  1. Windows
  2. Web
Hello,

I have designed an Index for a repository of documentation in which every cell has a Link to open the corresponding file.

It all works wonderfully until the paths start getting longer, since there are docens of directories and subdirectories deepness.

Is there any way so the link can work even if it's so long?

The error when you click on the link is:
1671645128431.png


I have also noticed that if I rightclick and open the "modify hyperlink", then copy the link to the file and paste it in my file explorer, it works... So I hope there is some way to bypass the error.

Thank you in advance
 
Thanks Joe.
It was only meant as an example and thinking that the OP new that. And if not, he/she would learn something what might be a plus.
If you say all of that, what about mentioning that I did not show to dimension all of these as strings.
Your signature says it all. Give a man a perfect code and he'll be happy for as long as no changes are required. Teach him when falling down to get up up and he'll learn something. (Changed to suit the occasion)
Yes, while it is not necessary, declaring the variables would be a good idea too.
I am not sure who you were directing your response to, the original poster, or Adam Gore.
If the original poster, note that the question is a few years old, so I doubt the original poster is still waiting for an answer.
If Adam Gore, that is their first post, so I do not think you can assume anything from that about their depth of knowledge about VBA.

The point is, when posting code, please post good code that will not return errors. You never know who may come across this thread in their searches, looking for answers.
We do not want people saying that the code posted on MrExcel is bad and doesn't work!
 
Upvote 0

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
You're right on both Joe.
I had not noticed that the Post was a couple years old. I will look after the second also.
I should not have posted directly without, what I normally do, have it in a module first.
 
Upvote 0

Forum statistics

Threads
1,221,525
Messages
6,160,327
Members
451,637
Latest member
hvp2262

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