By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,705 Members | 1,891 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,705 IT Pros & Developers. It's quick & easy.

Personal Library

100+
P: 675
I have several functions I want to use in various projects. How do I maintain 1 copy in a standard location, but available to all projects?
Feb 23 '09 #1
Share this Question
Share on Google+
13 Replies


Expert 100+
P: 1,287
I believe you can keep a code module in a db, then import it to any new project.
Feb 23 '09 #2

Expert 100+
P: 1,287
Or did you mean you want to avoid having to import?
Feb 23 '09 #3

FishVal
Expert 2.5K+
P: 2,653
Hello, OldBirdman.

In the projects where those functions are desired to be available add a reference to that common mdb file.

Tools > References > [Browse ...] button and choose an appropriate mdb.

Regards,
Fish.
Feb 23 '09 #4

100+
P: 675
I tried this, and the Browse... eventually wanted a *.olb;*.tlb;*.dll so didn't work. My functions might be
Expand|Select|Wrap|Line Numbers
  1. Public Function Max(varFirst as Variant, varSecond as Variant) as Variant
  2. If varFirst > varSecond then Max = varFirst else Max = varSecond
  3. End Function
This is a simplified example, so don't expand on the idea, I know about ParamArray, etc.
So I now have a project consisting of above function and similar ones. What next?
Feb 23 '09 #5

FishVal
Expert 2.5K+
P: 2,653
:)

"*.olb;*.tlb;*.dll" are not the only file types available from "File types" dropdown list.

*.exe, *ocx, *.mdb, *.mde, *.mda, *.adp, *.ade and even *.* are available as well.

Regards,
Fish.
Feb 23 '09 #6

100+
P: 675
Don't you ever sleep?
Thankx, I got it working. I somehow have never had the list of extensions not be correct, so I overlooked that I could choose others.
Feb 23 '09 #7

NeoPa
Expert Mod 15k+
P: 31,411
I've learned something new from this one :)

I had no idea this was possible.
Feb 24 '09 #8

100+
P: 365
So if you make a DB full of functions and link in this way then you can just refer to them as norm!?

Is there any performance hit?

Dan
Feb 24 '09 #9

100+
P: 675
I'm not concerned about performance, as these are primary to handle user input, and most users can't type over about 250 characters/minute. Any code to handle user interface is probably not optimum. If one of these were going to be called by a query with 100K+ rows, yes, then this would be an issue. But then again, I would probably be writing the function to specifically address the EXACT problem, not a general function.
Feb 25 '09 #10

puppydogbuddy
Expert 100+
P: 1,923
For anyone that is interested, here is a reference source:
http://msdn.microsoft.com/en-us/libr...ffice.10).aspx
Feb 25 '09 #11

NeoPa
Expert Mod 15k+
P: 31,411
Hey pDog, Any idea why I might not have the Code Librarian installed on my PC? I tried to follow the instructions (I have full Office 2003 Pro installed BTW).
Feb 25 '09 #12

100+
P: 675
Thanks puppydogbuddy, but that link, and subsequent ones from there lost me. I'll quit with post #6 as it does what I need.
We link tables all the time, and if there were a cost/efficiency issue with linking, it should have come up there.
Feb 25 '09 #13

puppydogbuddy
Expert 100+
P: 1,923
@NeoPa
I believe the Code Librarian is included with the Office XP Developers Productivity ToolKit, which is a separate download. The problem is there so many downloads, I would have to check them all out. see this link:

http://beqiraj.com/office/2003/developer/index.asp
Feb 25 '09 #14

Post your reply

Sign in to post your reply or Sign up for a free account.