Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Addin out of range error
Thanks in advance for any assistance.
I am having a bit of trouble with add-ins. I have a macro that, among other things, checks to see if a particular add-in is installed and loaded into memory in Excel. The problem is that if the add-in is not registered in the list of available add-ins in the Tools-Addins menu it errors out in a subscript out of error range. I tried a number of ways to trap the error, none of which have been successful. Note: My code is neither clean nor pretty. Examples: dim myval as boolean On Error Resume Next If IsError(Application.AddIns("Unloaded Addin").Installed = True) Then myval= false --------------------------------- dim myval as boolean If IsError(Application.AddIns("Unloaded Addin").Installed = True) Then GoTo opt_out ' (other code exit sub opt_out: myval = false 'return to main code --------------------------------- Each of these generates the Run time error '9':Subscript out of range. Any ideas on how to check this and not generate an error if the addin isn't listed as "registered" with Excel? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Addin out of range error
This works for me
Dim myval As Boolean Dim addn As AddIn myval = False For Each addn In Application.AddIns If LCase(addn.Name) = "unloaded addin.xla" Then myval = addn.Installed Exit For End If Next addn MsgBox myval -- HTH RP (remove nothere from the email address if mailing direct) "Trux" wrote in message ups.com... Thanks in advance for any assistance. I am having a bit of trouble with add-ins. I have a macro that, among other things, checks to see if a particular add-in is installed and loaded into memory in Excel. The problem is that if the add-in is not registered in the list of available add-ins in the Tools-Addins menu it errors out in a subscript out of error range. I tried a number of ways to trap the error, none of which have been successful. Note: My code is neither clean nor pretty. Examples: dim myval as boolean On Error Resume Next If IsError(Application.AddIns("Unloaded Addin").Installed = True) Then myval= false --------------------------------- dim myval as boolean If IsError(Application.AddIns("Unloaded Addin").Installed = True) Then GoTo opt_out ' (other code exit sub opt_out: myval = false 'return to main code --------------------------------- Each of these generates the Run time error '9':Subscript out of range. Any ideas on how to check this and not generate an error if the addin isn't listed as "registered" with Excel? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Addin out of range error
dim myval as boolean On Error Resume Next Myval = Application.AddIns("Unloaded Addin").Installed On Error goto 0 ' at this point, if the addin is installed, then myval will equal True. Otherwise, it is false -- Regards, Tom Ogilvy "Trux" wrote in message ups.com... Thanks in advance for any assistance. I am having a bit of trouble with add-ins. I have a macro that, among other things, checks to see if a particular add-in is installed and loaded into memory in Excel. The problem is that if the add-in is not registered in the list of available add-ins in the Tools-Addins menu it errors out in a subscript out of error range. I tried a number of ways to trap the error, none of which have been successful. Note: My code is neither clean nor pretty. Examples: dim myval as boolean On Error Resume Next If IsError(Application.AddIns("Unloaded Addin").Installed = True) Then myval= false --------------------------------- dim myval as boolean If IsError(Application.AddIns("Unloaded Addin").Installed = True) Then GoTo opt_out ' (other code exit sub opt_out: myval = false 'return to main code --------------------------------- Each of these generates the Run time error '9':Subscript out of range. Any ideas on how to check this and not generate an error if the addin isn't listed as "registered" with Excel? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
AddIn Functions Have File Path and #NAME? Error | New Users to Excel | |||
UniquifyForUser error for Essbase AddIN | Excel Worksheet Functions | |||
&H80004005 (-2147467259) error when opening eurotool addin | Excel Discussion (Misc queries) | |||
Excel Addin:Setting the range to the Excel.Range object range prop | Excel Worksheet Functions | |||
Cannot copy addin locally error? | Excel Programming |