WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Collections

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

OLE and Collections

Keywords: 	  OLE Collections

Question:

Here's a vba procedure that'll find each Add-In in excel
Sub junk()
Dim x As Integer
For x = 1 To Application.AddIns.Count
MsgBox (Application.AddIns(x).Name)
Next
End Sub
I just don't know how to reference the collection of items (ie: Application.AddIns(x).Name) with winbatch. Does it have anything to do with the ( :: ) ???

I can get winbatch to count how many...

xls = Objectopen("excel.application")
xls.VISIBLE = @True
xladd = xls.addins
message("WBT Excel Addins", xladd.count)

xls.Quit
objectclose(xls)

Answer:

Some older versions of WinBatch have had some problems with OLE. For example, I don't think WinBatch 99G handled "collections". You might try downloading the latest version of WinBatch. And try this...
;This script works with 2000c
msg = ""

appExcel = Objectopen("excel.application")
appExcel.VISIBLE = @True
excelAddins = appExcel.addins
addinCount = excelAddins.count

For X = 1 To addinCount
        addin = excelAddins.item(X)
        addinName = addin.name
        msg = StrCat(msg, X, ". ", addinName, @CRLF)
Next

appExcel.Quit
objectclose(appExcel)

Message("WinBatch and Collections", msg)



Article ID:   W14280
Filename:   OLE and Collections.txt
File Created: 2000:06:21:11:32:06
Last Updated: 2000:06:21:11:32:06