COMAddins

Paul Sansom

Board Regular
Joined
Jan 28, 2013
Messages
178
Office Version
  1. 2021
  2. 2016
Platform
  1. Windows
Hi & Happy New Year 2018

Am i being too simplistic? Trying to check if a COM Add-In "BERTRibbon.Connect" is installed and if not ignore a line of code that then turns it off


Code:
    If Application.Addins("BERTRibbon.Connect").Installed = False Then GoTo jmp
This doesn't work, and I guess because it is for Addins rather than a Com Add-In ??? Getting an out of subscript range error!

I cant use this
Code:
If Application.COMAddIns("BertRibbon.connect").Connect = False
as I get an error if the Add-In is not previously installed

Any guidance gratefully appreciated.... Paul
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
So here is my solution to my specific issue. It is not the solution I sought rather a work around. I just handle the error if the Addin does not exist rather than code around if the Com Add-In is not installed
Not very elegant but it works.

So.... If BERT (comsAdd-In) is not installed then the error is trapped at NoBERT, and if installed and no error is seen then BERT Add-in always starts not intitated (switched off)

Code:
On Error GoTo NoBERT
    If Application.COMAddIns("BertRibbon.connect").Connect = True Then Application.COMAddIns("BertRibbon.connect").Connect = False
Continue:

At the bottom of my Private Sub Workbook_Open() is my error handling.
Code:
Done:
    Exit Sub
NoBERT:
    MsgBox Range("MsgBoxBERT")
    GoTo Continue

End Sub

There is no call to Done: so really it does not need to be there but it marks the Exit Sub point
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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