Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Dynamically add a Reference to an Add-In in VBA (Excel 2000?)

Is it possible, in VBA, to ADD a reference to an Addin dynamically -
WITHOUT
using the Tools/Reference dialog box?

In other words:
I have an Addin (.xla) that contains functions/methods.
I wish to use these functions/methods in the VBA of a WorkBook.
I do not know where the .xla is located - except that it's in the same
folder as the Workbook itself.

And Finally, since many people will be using the Workbook, I do not
want to
ask them to 'manually' add a 'reference' to the XLA. This has to be
done automatically...

So, is it possible to Dynamically add a reference to my Add-In, using
VBA in Excel 2000 (without requiring any other add-ins if possible?)

THANKS !!
Richard

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Dynamically add a Reference to an Add-In in VBA (Excel 2000?)

Dim a As AddIn
Set a = Application.AddIns.Add("someaddin.xla", True)
a.Installed = True

Tools/references in VBA adds references to dll or other components not a
addin
Addin can be added from tools/addins from excel's main window itself.

"Richard" wrote in message
oups.com...
Is it possible, in VBA, to ADD a reference to an Addin dynamically -
WITHOUT
using the Tools/Reference dialog box?

In other words:
I have an Addin (.xla) that contains functions/methods.
I wish to use these functions/methods in the VBA of a WorkBook.
I do not know where the .xla is located - except that it's in the same
folder as the Workbook itself.

And Finally, since many people will be using the Workbook, I do not
want to
ask them to 'manually' add a 'reference' to the XLA. This has to be
done automatically...

So, is it possible to Dynamically add a reference to my Add-In, using
VBA in Excel 2000 (without requiring any other add-ins if possible?)

THANKS !!
Richard



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Dynamically add a Reference to an Add-In in VBA (Excel 2000?)

try:

Sub AddMeAsReference()
If ActiveWorkbook Is ThisWorkbook Then
Beep
If ActiveWorkbook.VBProject.Name = ThisWorkbook.VBProject.Name Then
Beep
Else
ActiveWorkbook.VBProject.References.AddFromFile ThisWorkbook.FullName
End If

End Sub

BUT (and it's a BIG but)

the user's security settings can allow and prevent
"Access to Visual Basic Project"
if that access is OFF than any attempt to read or alter
vbproject properties will fail.


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Richard wrote :

Is it possible, in VBA, to ADD a reference to an Addin dynamically -
WITHOUT
using the Tools/Reference dialog box?

In other words:
I have an Addin (.xla) that contains functions/methods.
I wish to use these functions/methods in the VBA of a WorkBook.
I do not know where the .xla is located - except that it's in the same
folder as the Workbook itself.

And Finally, since many people will be using the Workbook, I do not
want to
ask them to 'manually' add a 'reference' to the XLA. This has to be
done automatically...

So, is it possible to Dynamically add a reference to my Add-In, using
VBA in Excel 2000 (without requiring any other add-ins if possible?)

THANKS !!
Richard

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
Excel 2000 formula to dynamically sum adjacent rows and columns whererows inserted/deleted sga[_2_] Excel Worksheet Functions 3 April 12th 11 01:23 PM
How to reference cells dynamically ArthurN Excel Discussion (Misc queries) 2 February 23rd 06 10:08 AM
How to dynamically add a reference to personal.xls ? John Mitchell[_2_] Excel Programming 2 April 11th 05 12:08 PM
Excel 2000 Dynamically Set Print Area Tom Farrell Excel Programming 1 December 5th 03 08:23 AM
Changing Reference Dynamically Shashi Bhosale Excel Programming 1 September 9th 03 03:36 PM


All times are GMT +1. The time now is 01:26 PM.

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

About Us

"It's about Microsoft Excel"