Check if Add-In is loaded

MartinK

Active Member
Joined
Oct 30, 2003
Messages
384
Hello,
I have an add-in that is not installed (take it as fact) and is started via command line:
C:\TM1S7\Programs\tm1.xla /e
as a new instance of Excel. The add-in is kind of OLAP database.

In my code I would like to check whether I have started Excel with this add-in or not, if not I want to to exit the routine at its very start.

Is this the right approach? (I feel sorry I have to use a new variable, have already quite a lot in the routine, Explicit is On)
Code:
'check for TM1, exit if not loaded
On Error Resume Next
    Set chkTM = Workbooks("TM1.xla")
    If Err Then MsgBox "TM1 Not Loaded!" & vbLf & vbLf & "Can't continue!", vbCritical + vbOKOnly, "TM1 not loaded": Exit Sub
    Err.Clear
On Error GoTo 0
Thank you
Martin
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
try this

Code:
Option Compare Text
Sub test_code()
For Each wb In Application.AddIns
If wb.Name = "tm1.xla" Then GoTo 10
Next wb
Exit Sub
10:
' rest of code here
End Sub
 
Upvote 0
Hello,
this does not seem to work as the Application does not recognize "tm1" as add-in. It has never been installed.
I think this is because if you install it, it loads always with Excel which basically I do not want, it slows down the system and I do not want to re-install/install all the time.
That's why I have the command line in Excel Shortcut 2.
Thanks
Martin
 
Upvote 0

Forum statistics

Threads
1,214,789
Messages
6,121,605
Members
449,038
Latest member
Arbind kumar

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