Nov 14 2021 09:14 PM
Nov 14 2021 09:14 PM
I have two VBA related questions for MS Project.
1) How do I find the Default File Location?
In Excel it is easy with Application.DefaultFilePath but I can't seem to find an equivalent in MS Project.
2) How can I set the default Task Mode to Auto Scheduled for all new projects?
I know how to do it in the manually in the options but I'm looking for a VBA approach.
Nov 15 2021 07:46 AM
The default file path for save operations is controlled by the Project options setting. Unfortunately those settings are not readable directly as they are in Excel. I haven't tried this but it may be possible to get the default file path by creating and querying a FileSystemObject.
Another option is an indirect method and that is simply opening a file you know is in the default location and then using: ActiveProject.FullName
On your other question, for whatever reason the scheduling mode is not an exposed parameter when setting options using VBA. Sorry.
Hope this helps.
Nov 15 2021 04:06 PM
Nov 15 2021 06:00 PMSolution
It is a little strange about the auto/manual scheduling option not being available via VBA, all the other scheduling options are.
Yes, you can set auto/manual in the registry. This is what it looks like on my PC, which is currently set for auto schedule.
Nov 16 2021 03:55 PM
Nov 16 2021 04:30 PM
Nov 23 2021 09:11 PM
Sorry for taking so long to get back (non schedule based project work got in the way ).
No I hadn't added a line to save the project. I would have thought as I'm changing the default for new schedules then a save of the current one would not be necessary.
However I added one, and this is where we now enter the Twilight Zone.
New schedules were being created with Auto Scheduled tasks as desired. But when looking at the MS Project settings it was still showing Manual Scheduled as the default setting for new schedules ????
Changing this MS Project setting in the standard GUI interface no longer had any effect, I would set it for Auto Scheduled, Leave, and upon going back in it said Manually Scheduled again. Yet new schedules continued to be created as Auto Scheduled.
I managed to restore normal functionality by using RegEdit to restore the setting, and I think I'll stick with manual instructions to get this setting as desired.
Nov 24 2021 08:10 AM