Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default if addin loaded on command line, it is not in addins collection

In the example -

ReDim arrXLA(1 To UBound(vasAddins))


would be better like this

ReDim arrXLA(1 To UBound(vasAddins)) As Workbook

Regards,
Peter T


"Peter T" <peter_t@discussions wrote in message
...
Maybe the following will work for you, ie set references to all loaded
addins including any not in the addins collection.

If needs you could compare with the addins collection to determine if each
loaded addin exists in the collection, if it exists is it installed or if
exists but not installed it must have been loaded by other means. (BTW
compare using workbook.Title not .Name)

Sub test2()
dim i as Long
Dim s As String
Dim nm As Name
Dim vasAddins
Dim colAddins As AddIns

Set nm = ActiveWorkbook.Names.Add("myAddins", "=DOCUMENTS(2)")
' must be in a normal xls, so not thisworkbook if it's an addin

vasAddins = Application.Evaluate(nm.Name)

nm.Delete

If IsError(vasAddins) Or IsEmpty(vasAddins) Then
' no addins or method not successful
Exit Sub
End If

For i = 1 To UBound(vasAddins)
'remove any apostrophes
#If VBA6 Then
s = Replace(vasAddins(i), "'", "")
#Else
s = Application.Substitute(vasAddins(i), "'", "")
#End If
vasAddins(i) = s
Next

ReDim arrXLA(1 To UBound(vasAddins))
For i = LBound(vasAddins) To UBound(vasAddins)
Set arrXLA(i) = Workbooks(vasAddins(i))
Debug.Print arrXLA(i).FullName
Next

End Sub

Regards,
Peter T

"scotty" wrote in message
oups.com...

thank you for your responses.

the unfortunate part is i am writing code to discover what addins are
loaded and then peform various mergers etc. So, what i really needed
was to run through the workbooks collection, do a strcomp on xla to
pick them out.

it seems i need prior knowledge of their names as the collection loop
won't work.





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change the order in which excel addins gets loaded? Joseph Excel Discussion (Misc queries) 0 June 24th 05 07:56 AM
Problems building Excel Addin from Command Line LoadBehavior changes Yani Excel Programming 1 March 14th 05 03:18 PM
Addin opened but not loaded Jac Tremblay[_3_] Excel Programming 1 November 30th 04 04:15 PM
XLL addin not loaded! Tetsuya Oguma[_4_] Excel Programming 6 October 22nd 04 02:54 PM
Do the Addins belong to a workbook, or are they global to all workbooks loaded? Chip Pearson Excel Programming 3 August 6th 03 11:01 PM


All times are GMT +1. The time now is 07:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"