Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default Importing libraries explicitly in macro code

Have you written this code? Have you distributed it? How are you writing
the code?
What actual problem are you encountering, rather than what problems you
think you may encounter. I'm happy to help, but what is the actual problem?
References are saved in addins...



--
www.alignment-systems.com


"shivboy" wrote:


Hi John,

The reason I raised this question was because I am making a macro in
Excel VBA which creates tables in Access, then provides user form to
enter data into the tables and finally retrieve data from the tables to
generate reports. Now, to do all this, I have had to use various library
references while making the code work. Since I had to manually go to
Tools References to import the libraries, I am sure that the same
issue would lie with every user who would run the macro on his/her PC.
In that case, I cannot expect the user to first import all the files
manually and then start using the macro. It is for that purpose that I
wanted to inherit / import the required libraries into the code so that
wherever the code is run it works fine.

I am sure there must be a way to import these libraries so as to ensure
that the macro works fine everytime it is run.

Peace,

Shivboy

John.Greenan Wrote:
if you set a workbook reference then this should remain in you addin
after
you distribute it. What is the problem you are encountering - that the
user
does not have the dlls on his/her PC? There's no way to statically
link in
excel vba.

You can try and use Microsoft Visual Basic for Applications
Extensibility
5.3 - typically installed in "C:\Program Files\Common Files\Microsoft
Shared\VBA\VBA6\VBE6EXT.OLB" and then use

Dim oReference As VBIDE.Reference
and

ThisWorkbook.VBProject.References.AddFromFile
or
ThisWorkbook.VBProject.References.AddFromGuid

to add the references at run time. It's quite tricky, as you will have
to
identify the GUID or file names and then work out how to handle the
missing
reference.



--
www.alignment-systems.com


"shivboy" wrote:


I am working on a project which uses the following object libraries:

Microsoft DAO 3.6 Object Library
Microsoft ADO Ext. 2.8 for DDL and Security
Microsoft Access 10.0 Object Library
Microsoft ActiveX Data Objects 2.0 Library

How can I explicitly inherit these libraries in my macro code so

that
no error is thrown due to non-inheritance of the libraries in user's
machine.

Furthermore, is there a location where I can find the complete
reference list of these libraries?

Please help.

Peace,

Shivboy


--
shivboy

------------------------------------------------------------------------
shivboy's Profile:

http://www.excelforum.com/member.php...o&userid=35137
View this thread:

http://www.excelforum.com/showthread...hreadid=551762




--
shivboy
------------------------------------------------------------------------
shivboy's Profile: http://www.excelforum.com/member.php...o&userid=35137
View this thread: http://www.excelforum.com/showthread...hreadid=551762


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code libraries what format stored in? just out of interest Diddy Excel Discussion (Misc queries) 0 August 5th 08 11:06 AM
Importing libraries Roro Excel Discussion (Misc queries) 0 April 7th 06 01:31 PM
How to explicitly set the regional code of an individual spreadsheet Scott Steiner Excel Discussion (Misc queries) 1 November 21st 05 02:34 PM
Referencing Libraries through code. Purnima Excel Programming 2 July 10th 05 03:23 PM
Code libraries usable in all of Office? Maury Markowitz Excel Programming 4 March 29th 05 03:49 PM


All times are GMT +1. The time now is 08:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"