adding Add-ins

dbrull

Board Regular
Joined
Jun 25, 2002
Messages
71
is it possible (and if so how) to have a workbook upon opening to check if a certain Add-in is selected and if not select it?

I need the Analysis ToolPak and Analysis ToolPak VBA to be on.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
dbrull,

Following code create a reference to A/T VBA in Your VBA-project.

However, the code does not check wether the add-in is installed on the computer or not.

<PRE>
<FONT color=blue>Sub </FONT>Create_Reference_()

<FONT color=#ff0000> 'You need to set a reference to Microsoft Visual Basic for Applications Extensibility 5.3
</FONT>
<FONT color=#ff0000> 'via Tools | Reference
</FONT>
<FONT color=blue>Dim </FONT>oVBReferens<FONT color=blue> As</FONT> VBIDE.Reference

<FONT color=blue>Dim </FONT>wbBok<FONT color=blue> As</FONT><FONT color=blue> Workbook</FONT>

<FONT color=blue>Set </FONT>wbBok = ThisWorkbook



<FONT color=blue>On Error</FONT> <FONT color=blue>Resume </FONT>Next



<FONT color=blue>Set </FONT>oVBReferens = wbBok.VBProject.References("atpvbaen")



<FONT color=blue>If </FONT>oVBReferens Is<FONT color=blue> Nothing</FONT> Then

wbBok.VBProject.References.AddFromFile _

Application.AddIns("Analysis ToolPak - VBA").FullName

MsgBox "Reference created to this project."

<FONT color=blue>Else</FONT>

MsgBox "Reference already exist."

<FONT color=blue>End If</FONT>

<FONT color=blue>End Sub</FONT>










</PRE>

HTH,
Dennis
 
Upvote 0
thanks

i get a message that says "User Defined type not Defined"

and oVBReferens is highlighted.

any ideas?
 
Upvote 0
You need to set an outside reference to Excel. To do this from the VBA editor click: Tools-References, check the reference. This window is not much help and I myself have difficulty determining which reference to set? JSW
 
Upvote 0
I use the following without requiring the extra reference.

Function IsAddinLoaded() As Boolean
On Error GoTo NotInstalled
If AddIns("Conditional Sum Wizard").Installed = False Then
IsAddinLoaded = False
End If
If AddIns("Conditional Sum Wizard").Installed = True Then
IsAddinLoaded = True
Exit Function
End If
NotInstalled:
IsAddinLoaded = False
End Function

HTH
 
Upvote 0

Forum statistics

Threads
1,213,504
Messages
6,114,020
Members
448,543
Latest member
MartinLarkin

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