VBA Project Reference; How to in Access

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
Hi, I am thinking there is a way to do this.
I have i want to reference vba project that is located in db2, so click on > tools > reference > i browse for the file > and located db2 and selected it and then tested like.

Code:
[/FONT]
[FONT=Courier New]sub test[/FONT]
[FONT=Courier New] run "db2codetest1"[/FONT]
[FONT=Courier New]end sub[/FONT]
[FONT=Courier New]

it seems to work...however i set a password for vba project in db2 and then now when i try to run the same code it states err; "*Code not found...*"

Please advice.

Thanks in advance.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Not sure, but possibly you want to reset the reference (after setting the password - which you presumably must supply when you create the link).
 
Upvote 0
Hi Xen, thanks for replying....
I have tried that and still wont allow me to run this code located in another db...

Thanks again.
 
Upvote 0
I assume you are using a VBA passw3eord to protect you code. I never use VBA password to protect the code.. Besides they re easy to crack and only cause headaches.

When you deploy your library database just compile it into a mde/accde. This way the the VBA code is protect5ed.

Have you read about creating an Access add-in?

See:
Microsoft Access Add-in (Library Database) Tips, Hints and Gotchas
if you want to create an add-in for wide spread use outside your control then you should consider creating the MDE as an add-in with the USysRegInfo table. Otherwise just setting a reference works fine as Access 2000 and newer look in the same folder as the calling MDE for reference MDE.
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,258
Members
452,901
Latest member
LisaGo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top