I have written a VBA Programm that searches for certain Excel Files in a directory that the user has chosen. This produces a list of files, each of which is afterwards openend, some data copied and saved in the master workbook (from which the code runs).
The whole thing works very well... even with over 800 files.
However, in some instances, the code comes back with a runtime error 1004.
The problem, as near as I have been able to determine, is that if one of the files to be openened, has a file path that is longer than 255 characteres, then Excel craps out.
The exact same file will open perfectly if I move the file up one folder or shorten the name of the file. This is of course not a solution that I can give to my useres.
I have tested my programm, and it runs fine in all versions of excel from 2003 on to 2013, other than that pesky file path length.
Anyone know a workaround??? Thanks in advance for your time and help!