VBA to copy an entire project to another project

M

Maurice Birchler

I want to be able to use VBA in a blank .MPP project file to copy everything,
except the VBA code from another .MPP project. The objective being to get all
the calendars, custom fields, views, filters etc from the source project, yet
retain the VBA of the current project which is password protected. This
effectively provides the user with a VBA update, without exposing the
password.
Does anybody have a solution for VBA upgrades in project files ?
 
J

Jan De Messemaeker

Hi,

This is how I do it:

On error resume next
Organizerdeleteitem ...... All modules in the receiving file
on error...
Organizermoveitem... The modules thet have to be copied

Hope this helps
 
M

Maurice Birchler

Yes, I already do this for too.
What about the data? Tasks, resources and assignments etc?
 
J

Jan De Messemaeker

Hi Maurice,

Well I do start frrom a copy of the file, I onlly schange the VBA modules.
Doesn't that suit you?
HTH
 
M

Maurice Birchler

This technique works fine if the user running has access to the password that
is protecting the module.
What I need is a method for a user to replace the password protected module
in a user's project without providing the password to them.
 
J

Jan De Messemaeker

Hi,

Well, the alternative is to list everything you want to copy.
For resources, apply resource sheet and all resources filter, select all,
copy, paste in the new file
Likewise for tasks through task sheet
If you have to copy views that is thriugh OrganizeerMoveItem.
HTH
 
M

Maurice Birchler

It is simpler to export existing mpp as XML. Open the blank one with the new
VBA Module (password protected) and then open the XML file to merge.
XML also brings custom fields and calendars, leaving only Groups, Toolbars,
Maps, Forms, Tables, Filters, Views and Reports to be manually copied from
previous mpp using organiser.
 

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