Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a custom add-in I wrote that I want loaded up when another excel file
is loaded. My code: Dim o As Excel.AddIn For Each o In Application.AddIns If o.Name = "Planner.xla" Then o.Installed = true Exit For End If Next However, when it tries to set the Installed property, it raises an error: Runtime error 1004: Unable to set the installed property of the add-in class. Any suggestions on what to look for? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Looks like your Addin is not "registered"
Someone else will post more eloquently but, just cause you save as an addin doesn't add it to the addin collection. (somewhere in a library) If isaddin = true then all you need to do is open the file to load it. In the "other file" open_event - just add code to open your addin file if you want it to show up in Addin listing for user to uninstall then repost and i'll look it up "polandjc" wrote: I have a custom add-in I wrote that I want loaded up when another excel file is loaded. My code: Dim o As Excel.AddIn For Each o In Application.AddIns If o.Name = "Planner.xla" Then o.Installed = true Exit For End If Next However, when it tries to set the Installed property, it raises an error: Runtime error 1004: Unable to set the installed property of the add-in class. Any suggestions on what to look for? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Off the top of my head I think you need to use the set statement...
set o.installed = true -- HTH... Jim Thomlinson "polandjc" wrote: I have a custom add-in I wrote that I want loaded up when another excel file is loaded. My code: Dim o As Excel.AddIn For Each o In Application.AddIns If o.Name = "Planner.xla" Then o.Installed = true Exit For End If Next However, when it tries to set the Installed property, it raises an error: Runtime error 1004: Unable to set the installed property of the add-in class. Any suggestions on what to look for? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The Installed property is simply a Boolean property, so you don't
use Set. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Jim Thomlinson" wrote in message ... Off the top of my head I think you need to use the set statement... set o.installed = true -- HTH... Jim Thomlinson "polandjc" wrote: I have a custom add-in I wrote that I want loaded up when another excel file is loaded. My code: Dim o As Excel.AddIn For Each o In Application.AddIns If o.Name = "Planner.xla" Then o.Installed = true Exit For End If Next However, when it tries to set the Installed property, it raises an error: Runtime error 1004: Unable to set the installed property of the add-in class. Any suggestions on what to look for? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Polandjc -
just because you saved asaddin does not mean that the file is (or needs to be0 in the Addins collection. Do you want the user to be able to select and launch the addin with other files or only with your file? General purpose addins should be added to teh Addins collection addins.add " filepath/name" - puts it in visible list then installed - checks teh box Your's sounds like a special purpose addin so i would think that if you save asaddin and have the associated file open event open the addin and the file close event close the addin file you should get where you need to be. "Chip Pearson" wrote: The Installed property is simply a Boolean property, so you don't use Set. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Jim Thomlinson" wrote in message ... Off the top of my head I think you need to use the set statement... set o.installed = true -- HTH... Jim Thomlinson "polandjc" wrote: I have a custom add-in I wrote that I want loaded up when another excel file is loaded. My code: Dim o As Excel.AddIn For Each o In Application.AddIns If o.Name = "Planner.xla" Then o.Installed = true Exit For End If Next However, when it tries to set the Installed property, it raises an error: Runtime error 1004: Unable to set the installed property of the add-in class. Any suggestions on what to look for? |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
According to the documentation:
Set the Installed property of the add-in to True to install the add-in. To install an add-in that doesnt appear in the list of available add-ins, you must first use the Add method and then set the Installed property. The add-in appears on the list so I shouldn't need to register it. The IsAddin Property appears to be a read only property. Any other ideas? I tried doing a Workbooks.Open on it that does load the Addin. Jim "Vacation's Over" wrote: Looks like your Addin is not "registered" Someone else will post more eloquently but, just cause you save as an addin doesn't add it to the addin collection. (somewhere in a library) If isaddin = true then all you need to do is open the file to load it. In the "other file" open_event - just add code to open your addin file if you want it to show up in Addin listing for user to uninstall then repost and i'll look it up "polandjc" wrote: I have a custom add-in I wrote that I want loaded up when another excel file is loaded. My code: Dim o As Excel.AddIn For Each o In Application.AddIns If o.Name = "Planner.xla" Then o.Installed = true Exit For End If Next However, when it tries to set the Installed property, it raises an error: Runtime error 1004: Unable to set the installed property of the add-in class. Any suggestions on what to look for? |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks! I wondered if just opening it would be OK.
"Vacation's Over" wrote: Polandjc - just because you saved asaddin does not mean that the file is (or needs to be0 in the Addins collection. Do you want the user to be able to select and launch the addin with other files or only with your file? General purpose addins should be added to teh Addins collection addins.add " filepath/name" - puts it in visible list then installed - checks teh box Your's sounds like a special purpose addin so i would think that if you save asaddin and have the associated file open event open the addin and the file close event close the addin file you should get where you need to be. "Chip Pearson" wrote: The Installed property is simply a Boolean property, so you don't use Set. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Jim Thomlinson" wrote in message ... Off the top of my head I think you need to use the set statement... set o.installed = true -- HTH... Jim Thomlinson "polandjc" wrote: I have a custom add-in I wrote that I want loaded up when another excel file is loaded. My code: Dim o As Excel.AddIn For Each o In Application.AddIns If o.Name = "Planner.xla" Then o.Installed = true Exit For End If Next However, when it tries to set the Installed property, it raises an error: Runtime error 1004: Unable to set the installed property of the add-in class. Any suggestions on what to look for? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Installed Addin file opens when it shouldn't | Excel Discussion (Misc queries) | |||
Installed property Rights tool, now I cant edit hyperlinks! | Excel Discussion (Misc queries) | |||
Unable to set the XValues Property | Charts and Charting in Excel | |||
unable to set hidden property | Excel Programming | |||
Unable to get VLOOKUP property | Excel Programming |