Excel adding Add-ins :: MrExcel Message Board


 FAQFAQ
   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   FavoritesFavorites   StatisticsStatistics 
 RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Online StoreOnline Store

MrExcel Message Board Forum Index -> Excel Questions

adding Add-ins
Post new topic   Reply to topic
Last Thread | Next Thread  >   Printable version
  Author    Thread

dbrull
Board Regular


Joined: 26 Jun 2002
Posts: 71
Location: Minneapolis

Status: Offline

 Reply with quote  

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.

Post Thu Aug 22, 2002 2:18 pm 
 View user's profile Send private message Send e-mail ICQ Number

XL-Dennis
.


Joined: 28 Jul 2002
Posts: 1628
Location: Ístersund, Sweden
Flag: Sweden

Status: Offline

 Reply with quote  

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.


Sub Create_Reference_()

'You need to set a reference to Microsoft Visual Basic for Applications Extensibility 5.3

'via Tools | Reference

Dim oVBReferens As VBIDE.Reference

Dim wbBok As Workbook

Set wbBok = ThisWorkbook



On Error Resume Next



Set oVBReferens = wbBok.VBProject.References("atpvbaen")



If oVBReferens Is Nothing Then

wbBok.VBProject.References.AddFromFile _

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

MsgBox "Reference created to this project."

Else

MsgBox "Reference already exist."

End If

End Sub












HTH,
Dennis

_________________
Gone fishing

Post Thu Aug 22, 2002 3:34 pm 
 View user's profile Send private message

dbrull
Board Regular


Joined: 26 Jun 2002
Posts: 71
Location: Minneapolis

Status: Offline

 Reply with quote  

thanks

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

and oVBReferens is highlighted.

any ideas?

Post Thu Aug 22, 2002 6:41 pm 
 View user's profile Send private message Send e-mail ICQ Number

Joe Was
MrExcel MVP


Joined: 20 Feb 2002
Posts: 1135
Location: Central Florida, USA
Flag: Usa

Status: Offline

 Reply with quote  

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

_________________
JSW

Try and try again, " The way of the coder!"

Post Thu Aug 22, 2002 7:18 pm 
 View user's profile Send private message Send e-mail

Calypso
Board Regular


Joined: 22 Aug 2002
Posts: 13
Location: East Yorkshire, England

Status: Offline

 Reply with quote  

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

_________________

No sooner does man discover intelligence than he tries to involve it in his own stupidity - Jacques Cousteau

Post Sat Aug 24, 2002 6:36 am 
 View user's profile Send private message Send e-mail
  Display posts from previous:      

MrExcel Message Board Forum Index -> Excel Questions


Forum Jump:
Jump to:  

Post new topic   Reply to topic
Page 1 of 1



Add To Favorites

 


Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB: 2.0.4 © 2001 phpBB Group

Need help posting your first question? Read how to post

Need extra help ? Couldn't get the answer you needed ? Get a free quote from our Consulting Team

Download Colo's HTML Maker utility for displaying your Excel Worksheet on the board.

Download VB HTML Maker to post your code on the board


Check out our new index to 485 Excel Articles.


Return to MrExcel Consulting

All contents Copyright 1998-2004 by MrExcel.com
If you believe information posted here is from your copyrighted source, notify us per the Terms of Use
Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.