Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I keep getting run time error 91, "object variable with block variable not
set" when doing the following: First, create a Class Module called "CPM" whose content is Option Explicit Public Name as Collection The code I'm trying to run is: Option Explicit Dim D As Collection Dim C As CPM Sub test() Set C = New CPM Set D = New Collection D.Add "aa", "1" subB C.Name.Add "ss", "1" ' <----------------run time error subA End Sub Sub subA() C.Name.Add "tt", "2" ' <-------------- also want this to work End Sub Sub subB() D.Add "bb", "3" End Sub I can add data to D object, but the C object constantly reports that run time error. But the message makes no sense. (My intent is to add a lot more public collections to CPM, and minimize the amount of redundant coding that I have to do.) |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
errors..... | Excel Programming | |||
Too many ignored errors | Excel Programming | |||
Excel Throwing Circular Errors When No Errors Exist | Excel Worksheet Functions | |||
Unresolved Errors in IF Statements - Errors do not show in results | Excel Worksheet Functions | |||
VB Help Errors Out | Excel Programming |