Override for 218 character limit for filename & path when saving through VBA

I have a macro that publishes a PDF file and saves it to a shared directory. The filepath is quite long and I often run into the situation where the filename and path exceed the 218 character limit set in Excel. Is there a workaround for this? I am unable to use relative paths since this will be used by multiple users that may have the drives mapped differently.
LVL 1
James TalvyAsked:
Who is Participating?
 
bbaoIT ConsultantCommented:
it is always a good practice to define a relatively short, still meaningful convention for naming long filenames and folder names.

however, as a spare solution you may consider using SHORTENED version of filenames, the traditional 8.3 naming convention, instead of the long version in your VBA code.

foe example, use C:\PROGRA~1\ instead of C:\Program Files\, this may significantly reduce the string length for accessing a pathname.

FYI -

How to Find 8.3 Filenames
http://superuser.com/questions/348079/how-can-i-find-the-short-path-of-a-windows-directory-file

How Windows Generates 8.3 Filenamea from Long Filenames
https://support.microsoft.com/en-us/kb/142982
0
 
Rgonzo1971Commented:
Hi,

It doesn't seem possible
https://support.microsoft.com/en-us/kb/213983

Regards
0
 
ltpittCommented:
Change the file naming policy, I do not see many other solutions
0
 
JohnBusiness Consultant (Owner)Commented:
DON'T.  Shorten the filenames, else you be back saying something else does not work. Filenames that are too long is a universally bad idea.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.