Solved

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

Posted on 2016-08-26
4
60 Views
Last Modified: 2016-08-26
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.
0
Comment
Question by:James Talvy
4 Comments
 
LVL 49

Expert Comment

by:Rgonzo1971
ID: 41771772
Hi,

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

Regards
0
 
LVL 1

Expert Comment

by:ltpitt
ID: 41771819
Change the file naming policy, I do not see many other solutions
0
 
LVL 91

Expert Comment

by:John Hurst
ID: 41771866
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
 
LVL 37

Accepted Solution

by:
Bing CISM / CISSP earned 500 total points
ID: 41771987
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now