469,909 Members | 1,752 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,909 developers. It's quick & easy.

References in vba

Hello everybody:

I'd like to know what references in my vba code are used or not.

I work in a code made by another person previously, i founded to many
references and i believe that someones are not used.

I'd like to optimize the application ereasing the useless references.

Thanks a lot.
Jan 15 '08 #1
3 3606
On 15 jan, 16:27, "Tony Toews [MVP]" <tto...@telusplanet.netwrote:
CenturionX <darwinbaldr...@gmail.comwrote:
I'd like to know what references in my vba code are used or not.
I work in a code made by another person previously, i founded to many
references and i believe that someones are not used.
I'd like to optimize the application ereasing the useless references.

What version of Access? * Are you using ADO or DAO or both?

Do you have any references besides the basic three? *Are you sure you need them?
Write down the path and name of the extra ones (or put the following code in a module
and execute the code), delete from the references list and Compile and Save All.
Keep any necessary references and ensure they are distributed to the target system.

Dim ref As Reference

* * For Each ref In Access.References
* * * * Debug.Print ref.Name & " " & ref.FullPath & " " & ref.Major & "." & ref.Minor
* * Next ref

For a very detailed page on reference problems seehttp://www.accessmvp.com/djsteele/AccessReferenceErrors.html

Ctrl+G will take you into the Debug/Immediate window. *Then click on
Tools on the menu bar and References.

The Access 97 default references are:
Visual Basic for Applications
Microsoft Access 8.0 Object Library
Microsoft DAO 3.5x Object Library

The Access 2000 default references are:
Visual Basic for Applications
Microsoft Access 9.0 Object Library
OLE Automation
Microsoft ActiveX Data Objects 2.1 Library
* or
Microsoft DAO 3.6 Object Library

The Access 2002 default references when the MDB is created in Access
2000 format are:
Visual Basic for Applications
Microsoft Access 10.0 Object Library
OLE Automation
Microsoft ActiveX Data Objects 2.1 Library

The Access 2002 default references when the MDB is created in Access
2002 format are:
Visual Basic for Applications
Microsoft Access 10.0 Object Library
OLE Automation
Microsoft ActiveX Data Objects 2.5 Library.

The Access 2003 default references when the MDB is in A2000 format are
Visual Basic for Applications
Microsoft Access 11.0 Object Library
OLE Automation
Microsoft DAO 3.6 Object Library
Microsoft ActiveX Data Objects 2.1 Library

The Access 2003 default references when the MDB is in A2002/A2003 format are
Visual Basic for Applications
Microsoft Access 11.0 Object Library
OLE Automation
Microsoft DAO 3.6 Object Library
Microsoft ActiveX Data Objects 2.5 Library

Tony
--
Tony Toews, Microsoft Access MVP
* *Please respond only in the newsgroups so that others can
read the entire thread of messages.
* *Microsoft Access Links, Hints, Tips & Accounting Systems athttp://www.granite.ab.ca/accsmstr.htm
* *Tony's Microsoft Access Blog -http://msmvps.com/blogs/access/
THANKS Very usefull
Jan 15 '08 #2
CenturionX <da************@gmail.comwrote:
>I'd like to know what references in my vba code are used or not.

I work in a code made by another person previously, i founded to many
references and i believe that someones are not used.

I'd like to optimize the application ereasing the useless references.
What version of Access? Are you using ADO or DAO or both?

Do you have any references besides the basic three? Are you sure you need them?
Write down the path and name of the extra ones (or put the following code in a module
and execute the code), delete from the references list and Compile and Save All.
Keep any necessary references and ensure they are distributed to the target system.

Dim ref As Reference

For Each ref In Access.References
Debug.Print ref.Name & " " & ref.FullPath & " " & ref.Major & "." & ref.Minor
Next ref

For a very detailed page on reference problems see
http://www.accessmvp.com/djsteele/Ac...nceErrors.html

Ctrl+G will take you into the Debug/Immediate window. Then click on
Tools on the menu bar and References.

The Access 97 default references are:
Visual Basic for Applications
Microsoft Access 8.0 Object Library
Microsoft DAO 3.5x Object Library

The Access 2000 default references are:
Visual Basic for Applications
Microsoft Access 9.0 Object Library
OLE Automation
Microsoft ActiveX Data Objects 2.1 Library
or
Microsoft DAO 3.6 Object Library

The Access 2002 default references when the MDB is created in Access
2000 format are:
Visual Basic for Applications
Microsoft Access 10.0 Object Library
OLE Automation
Microsoft ActiveX Data Objects 2.1 Library

The Access 2002 default references when the MDB is created in Access
2002 format are:
Visual Basic for Applications
Microsoft Access 10.0 Object Library
OLE Automation
Microsoft ActiveX Data Objects 2.5 Library.

The Access 2003 default references when the MDB is in A2000 format are
Visual Basic for Applications
Microsoft Access 11.0 Object Library
OLE Automation
Microsoft DAO 3.6 Object Library
Microsoft ActiveX Data Objects 2.1 Library

The Access 2003 default references when the MDB is in A2002/A2003 format are
Visual Basic for Applications
Microsoft Access 11.0 Object Library
OLE Automation
Microsoft DAO 3.6 Object Library
Microsoft ActiveX Data Objects 2.5 Library

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
Jan 15 '08 #3
CenturionX <da************@gmail.comwrote in news:affc6981-42f8-4d51-
bd***************@i12g2000prf.googlegroups.com:
Hello everybody:

I'd like to know what references in my vba code are used or not.

I work in a code made by another person previously, i founded to many
references and i believe that someones are not used.

I'd like to optimize the application ereasing the useless references.

Thanks a lot.
Remove one. Click Compile. (It's under the debug heading). Problem? Reset
the reference.

Remove another one. Click Compile. No problem? Keep on truckin'.
Jan 16 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

17 posts views Thread by Tom | last post: by
22 posts views Thread by xmp333 | last post: by
33 posts views Thread by JKop | last post: by
11 posts views Thread by codebloatation | last post: by
14 posts views Thread by el_sid | last post: by
30 posts views Thread by jeremygetsmail | last post: by
3 posts views Thread by DonJefe | last post: by
9 posts views Thread by igor.kulkin | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.