Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Installing .XLA on file open


Using John Walkenbachs book I used the following code;

Dim InstalledProperly As Boolean
Private Sub Workbook_AddinInstall()
InstalledProperly = True
End Sub
Private Sub Workbook_Open()
If Not ThisWorkbook.IsAddin Then Exit Sub
If Not InstalledProperly Then
' Add it to the AddIns collection
If Not *InAddInCollection*(ThisWorkbook) Then _
AddIns.Add Filename:=ThisWorkbook.FullName
' Install it
AddInTitle = GetTitle(ThisWorkbook)
Application.EnableEvents = False
AddIns(AddInTitle).Installed = True
Application.EnableEvents = True
' Inform user
Msg = ThisWorkbook.Name & _
"has been installed as an add-in."
Msg = Msg & _
"Use the Tools Add-Ins command to uninstall it."
MsgBox Msg, vbInformation, AddInTitle
Call CreateMenu
End If
End Sub

When it runs I get "Compile Error:
Sub or Function not defined and it highlights the "InAddInCollection I
have bolded above. I want this to install properly no matter if the
user double clicks or file opens the file.

Any thoughts?


--
eklarsen
------------------------------------------------------------------------
eklarsen's Profile: http://www.excelforum.com/member.php...fo&userid=9001
View this thread: http://www.excelforum.com/showthread...hreadid=486737

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Installing .XLA on file open

Thats because you have to define InAddInCollection().
Try this:

Function InAddInCollection(wb) As Boolean
For Each Item In AddIns
If Item.Name = wb.Name Then
InAddInCollection = True
End If
Next Item
End Function

good luck.

/m

http://www.aminaahmed.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Installing .XLA on file open


Thanks, that worked with a little manapulation

--
eklarse
-----------------------------------------------------------------------
eklarsen's Profile: http://www.excelforum.com/member.php...nfo&userid=900
View this thread: http://www.excelforum.com/showthread.php?threadid=48673

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
Each time I open Exel says installing Excel features lucymongoose Excel Discussion (Misc queries) 0 June 18th 08 07:36 AM
Unable to open files after installing Office 2007 refresh !!! rkisling Excel Discussion (Misc queries) 2 October 5th 06 02:43 AM
How do I stop Word from installing every time I go to open it? Nigel Brown Excel Discussion (Misc queries) 0 August 9th 06 07:56 AM
Need sberet.msi file after installing SP-3. TPolsh Eagle Excel Discussion (Misc queries) 0 May 23rd 05 12:51 AM
Installing a CAB file Syed Zeeshan Haider[_7_] Excel Programming 6 May 19th 04 04:09 PM


All times are GMT +1. The time now is 07:57 AM.

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"