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
 

Some videos you may like

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

pcc

Well-known Member
Joined
Jan 21, 2003
Messages
1,345
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
 

MartinK

Active Member
Joined
Oct 30, 2003
Messages
384
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
 

Watch MrExcel Video

Forum statistics

Threads
1,126,923
Messages
5,621,622
Members
415,848
Latest member
LCC

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
Top