Accesing vba project from wb that has vba project password protected

C

cassidyr1

Hello all,

I have a few number of excel templates that are to contain the same vb
modules. The difference between them is just in presentation. Whe
updating the code in one template, this should be reflected in th
other templates. I have tried to write a vb program to export the vb
modules from the master template and then import into the others. Th
problem is that they all have a password set to lock the vba project.
Hence when I try to access the associated vba projec
(wb.vbprofect.vbcomponents("Module1").Export) are get an error as th
vb project is password protected. I know the password, so is ther
anyway of programmatically passing the password so as to open th
vbproject? Maybe through the .VBE object?

Thanks for any help you can offer!!

Cheers,

Richar
 
K

keepITcool

instead of having the same code reside in many templates
why not make 1 addin with all the code?

an addin is made very simply:
saveas => select addin (.xla) => save it.

you'll need to setup a user interface (toolbar menu)
as macro's in an addin do not appear in the Macro dialogs.

While developing you can toggle the workbook.Isaddin property
to hide / unhide the workbook.

copy the addin to the server and all your users and templates can work
with it. in VBE's immediate pane:type ?application.librarypath to find
the correct location.




keepITcool

< email : keepitcool chello nl (with @ and .) >
< homepage: http://members.chello.nl/keepitcool >
 

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