Project VBA - Open each file in a folder and make a change to each

M

mab9

We have a series of 250+ MS Project files that were built off of a
certain template. Now there is a need to make changes to the templates
& all the 250+ existing files that are out there. Rather than having to
open every file and do it manually, is there a VB script that will:

- Open all MS Project files in a certain folder one by one
- As each file opens, write certain changes
- Save changes to current file
- Close current file
- Open next file & repeat until all have been updated
 
M

Mike Glen

Hi ,

Try posting on the developer newsgroup as this one is closing down. Please
see FAQ Item: 24. Project Newsgroups. FAQs, companion products and other
useful Project information can be seen at this web
address:http://project.mvps.org/faqs.htm .

Mike Glen
Project MVP
 
J

Jan De Messemaeker

Hi,

I've written this many many times.
Look up the help for the VBA.Dir function, it has an example and all.
HTH

Jan - Project MVP


mab9 said:
We have a series of 250+ MS Project files that were built off of a
certain template. Now there is a need to make changes to the templates
& all the 250+ existing files that are out there. Rather tha n having to
open every file and do it manually, is there a VB script that will:

- Open all MS Project files in a certain folder one by one
- As each file opens, write certain changes
- Save changes to current file
- Close current file
- Open next file & repeat until all have been updated
 
J

Jan De Messemaeker

Hi,

Did I mention a sample? Don't remember.
By all means to access each mpp file in a folder use the following

Anaddress=vba.dir(folderaddress\*.mpp)

do while not len(anaddress)=0
.... handle the file as needed

anaddress=vba.dir
loop

Hope this helps,

--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620
For availability check:
http://users.online.be/prom-ade/Calendar.pdf
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top