View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
James Cox[_2_] James Cox[_2_] is offline
external usenet poster
 
Posts: 39
Default self-installing add-in?

Mike -

You didn't say what version of Excel you were working with, so this may not
apply.

I recently got bitten by a .xla that was part of a s/w package written by
some others in our company. The install for that package placed an .xla in
my C:\Program Files\Microsoft Office\Office10\XLStart folder and Excel was
starting it up every time Excel was opened - without it showing up in the
list of Add-Ins that you can access from the Tools menu button.

I don't know if there was a similar folder in earlier versions of Office,
but you might check this out.

Good luck!

James Cox


"Mike" wrote in message
...
Hello all...

I was wondering, as i've created an add-in to distribute to a few (not

very
computer savvy) colleagues at my office, how to properly install the

add-in
...

I tried putting

if addins("myaddin").installed = false then addins("myaddin").installed =
true

in the workbook open sub, thinking that then my colleagues can just
double-click on the xla file to open it and have it self-install. And it
works! complete with 40 or so loops through the workbook_open() and
workbook_addininstall() subroutines.... and of course, that's a problem
because the workbook_addininstall() sub adds a button to the worksheet

menu
bar, so 40 loops = 40 new buttons tacked on (visually, not all that
appealing for the end-user).

It seems like you have to wait or something for the addins collection to
list the add-in as installed?

Anyone know what I'm doing wrong?

also, in my workbook_addinunistall(), ctlTidy is nothing, it seems like

I'm
setting the scope improperly, but it was working only 10 minutes ago
TIA.

Option Explicit
Public ctlTidy As CommandBarButton
Dim BarOne As New clsToolbar


Private Sub Workbook_AddinInstall()
Set ctlTidy = InitButton ' initbutton is a function that returns a
commandbarbutton object
End Sub

Private Sub Workbook_AddinUninstall()
Set BarOne.WorksheetBar = Nothing
On Error Resume Next
ctlTidy.Delete
On Error GoTo 0
End Sub

Private Sub Workbook_Open()
Set BarOne.WorksheetBar = Application.CommandBars

If AddIns("tidyproductionreport").Installed = False Then
AddIns("tidyproductionreport").Installed = True


End Sub


TIA

--


__________________________________________________ __________________________
________________
Please reply to newsgroup so everyone can benefit.
Email address is not valid (see sparkingwire.com)

__________________________________________________ __________________________
________________