Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Object Variable not set

0 views
Skip to first unread message

Marc Pelletier

unread,
Jul 17, 1996, 3:00:00 AM7/17/96
to

I've written a program to compute a x by y matrix in my
database. In one of my For Loops I use the statement:

"For i = 1 To dc.Count",

and when I try to execute this the program, it gives me the
error "Object Variable not. set". HOWEVER, if I substitue
this line instead:

"For i = 1 To 5",

the program works great. But if I use any numbrer higher
then ~100, it gives me the error again. Does anyone know
why Lotus is acting the way it is? Could this be related to
a memory problem?

/Marc


The program:


Sub Click(Source As Button)
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Dim doc3 As NotesDocument
Dim item1 As NotesItem
Dim item2 As NotesItem
Dim x As Integer
Dim y As Integer
Dim TempArray(1 To 23, 1 To 7) As Integer

Set uidoc = workspace.CurrentDocument
Set doc3 = uidoc.Document
Set db = session.CurrentDatabase
Set dc = db.AllDocuments
For i = 1 To dc.Count
Set doc = dc.GetNthDocument(i)
Set item1 = doc.GetFirstItem( "Source" )
Set item2 = doc.GetFirstItem( "DocType" )

Select Case item2.Values(0)
Case "Annual Report" : x=1
Case "Brochure" : x=2
Case "Comment" : x=3
Case "Conference" : x=4
Case "Consultant Report" : x=5
Case "Customer Presentations" : x=6
Case"E-mail" : x=7
Case "Gossip" : x=8
Case "ISS Paper" : x=9
Case "Magazine" : x=10
Case"Newsletter" : x=11
Case "NewspaperArticle" : x=12
Case "Other" : x=13
Case "Photograph" : x=14
Case "Presentation" : x=15
Case "Press Release" : x=16
Case "RFQ/RFI" : x=17
Case "Rumour" : x=18
Case "Technical Journal" : x=19
Case "Trade Show" : x=20
Case "White Paper" : x=21
Case "Worl-wide-web" : x=22
Case Else : x=23
End Select

Select Case item1.Values(0)
Case "Competitor" : y=1
Case "Consultant" : y=2
Case "Customer" : y=3
Case "Nortel" : y=4
Case "Nortel Technology" : y=5
Case "Public" : y=6
Case Else : y=7
End Select

TempArray(x,y) = TempArray(x,y) + 1
Next

doc3.DI1 = TempArray(1,1)
doc3.DI2 = TempArray(1,2)
.
.
.
doc3.DI132 = TempArray(22,6)

Messagebox ( "Program Complete" )
End Sub

Michael Werry

unread,
Jul 20, 1996, 3:00:00 AM7/20/96
to

I had that or something similar happen to me. I used the debugger,
checked all the object values as I stepped through, and lo and
behold, for some reason the 'dc' document collection object was not
initialized. I do remember that the reason I got that error was
because the object didn't in fact exist at the time.

Michael Werry
LCNC
Guy4...@aol.com

0 new messages