LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Set Errors

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
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
errors..... [email protected] Excel Programming 1 December 6th 06 01:05 PM
Too many ignored errors [email protected] Excel Programming 0 December 5th 06 09:42 AM
Excel Throwing Circular Errors When No Errors Exist MDW Excel Worksheet Functions 1 August 10th 06 02:15 PM
Unresolved Errors in IF Statements - Errors do not show in results Markthepain Excel Worksheet Functions 2 December 3rd 04 08:49 AM
VB Help Errors Out Brad[_10_] Excel Programming 0 November 21st 03 10:44 PM


All times are GMT +1. The time now is 01:24 PM.

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"