Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Object Not a Collection 1

Status
Not open for further replies.

Pleonasm

Technical User
May 20, 2004
121
CA
Here is an interesting problem. An object used for VBScripting with Norton Ghost 10 is reported as a string array, yet an attempt to access any of its elements produces the error “Object not a collection.”

The object is: [tt]Set Ghost = CreateObject("Symantec.ProtectorAuto")[/tt]

[ul][tt]IsArray(Ghost.SupportedEventMonitors)[/tt] reports “true”
[tt]TypeName(Ghost.SupportedEventMonitors)[/tt] reports “string”
[tt]LBound(Ghost.SupportedEventMonitors)[/tt] reports 0
[tt]UBound(Ghost.SupportedEventMonitors)[/tt] reports 4[/ul]

Yet, a subscript reference such as [tt]Ghost.SupportedEventMonitors(1)[/tt] (or the use of the [tt] For Each oEventMonitor In Ghost.SupportedEventMonitors[/tt] technique) produces the error “Object not a collection.”

How can I gain access to the elements of this string array?

Thank you for your assistance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top