WORKAROUND
To work around this limitation, you can use the following methods for
reducing the number of characters in the Filenames argument. The
appropriate method will vary, based on the version of Microsoft Project you
are using, and whether all project files are located in the same folder.
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
Method 1: Setting the Default Directory Prior to Consolidation
If you are using Microsoft Project version 4.1 for Windows 95, you can use
this method to work around this problem.
If all the files to be consolidated are in the same folder, you can use the
ChDir method to set the default folder. If you use this method, you avoid
using the complete path to the files.
NOTE: This method will not work with Microsoft Project version 4.0.
The following procedure is an example of how you can use ChDir to avoid
repeating long paths:
Sub Consolidate_Projs()
'Change the default folder.
ChDir "C:\mydata\Pjfiles\myproj1"
'Consolidate 5 project files in the default folder.
ConsolidateProjects _
Filenames:="P1.MPP,P2.MPP,P3.MPP,P4.MPP,P5.MPP"
End Sub
Method 2: Using the Wildcard Characters "*" and "?"
If you're using Microsoft Project version 4.0, you can use this method as a
workaround.
You can use wildcard characters to shorten the text string of the Filenames
argument. A wildcard is a character you can use to represent other
characters when you search fields for text. Wildcards include the asterisk
(*), which represents any set of characters in a particular position, and
the question mark (?), which represents any single character in a
particular position.
NOTE: This method will not work with Microsoft Project version 4.1 for
Windows 95.
The following sample macro uses a Wildcard character to consolidate all
Microsoft Project files into the C:\mydata\Pjfiles folder.
Sub Consolidate_Projs()
'Consolidate all files with an MPP extension that are in the
'C:\mydata\Pjfiles folder.
ConsolidateProjects Filenames:="C:\mydata\Pjfiles\*.mpp"
End Sub
Method 3: Performing Multiple ConsolidateProjects Until all Files Are Consolidated
As another possible workaround, you can consolidate files up to the 255
character limit and save the resulting consolidated project file. If there
are still more files to consolidate, perform another consolidation
including the previously consolidated project AND any remaining files up to
the 255 character limit. Repeat this process of consolidation and
consolidating consolidated projects until all files have been consolidated
or until you reach the 80 file file limit. This will work for versions 4.0
and 4.1 of Microsoft Project.
Method 4: Using Shorter File Names and Shorter Directory Names
Finally, it is possible to use a shorter path to store the files or to use
shorter file names. On Microsoft Project for Windows version 4.0, one way
you can make your file names shorter is to omit the extension. For
example, instead of specifying "Project1.mpp, Project2.mpp" and so forth,
you could specify these files as "Project1,Project2". Making your path and
file names shorter works for versions 4.0 and 4.1 of Microsoft Project.
REFERENCES
"Microsoft Project User's Guide," version 4.0, Chapter 11
"Microsoft Project User's Guide," version 4.1, Chapter 10
For additional information on using the ChDir method, please see the
following article in the Microsoft Knowledge Base:
130327 PRJ4: ChDir Command Doesn't Change the Default Directory
For additional information on using string size limitations in Visual Basic
for Applications in Microsoft Project, please see the following article in
the Microsoft Knowledge Base:
113000 Only First 255 Characters in String Argument Recorded in Macro