I have the following classes defined in their respective modules:
eslSignature
Public OnPage As Long
Public Width As Long
Public Left As Long
Public Top As Long
Public Height As Long
eslSigner
Public EmailAddress As String
Public FirstName As String
Public LastName As String
Public Title As String
Public SigningOrder As Long
Public SignerSignatures As Collection
In my regular module I have the following:
Sub TestCollections2()
Dim i As Long, t As Long, x As Long
Dim Signers As Collection
Dim Signatures As Collection
Dim Signer As eslSigner
Dim Signature As eslSignature
Set Signers = New Collection
Set Signatures = New Collection
For t = 1 To 2
Set Signer = New eslSigner
With Signer
.FirstName = "FirstName" & t
.LastName = "LastName" & t
.EmailAddress = FirstName & t & "@gmail.com"
.Title = "User" & t
.SigningOrder = t
For i = 1 To 2
Set Signature = New eslSignature
With Signature
.OnPage = i
.Width = 200
.Left = 175
.Top = 165
.Height = 50
End With 'Signature
Signatures.Add Signature
Set Signature = Nothing
Next i
.SignerSignatures.Add Signatures 'Error happens here.
Set Signatures = Nothing
End With 'Signer
Signers.Add Signer
Set Signer = Nothing
Next t
End Sub
I'm getting a "Object variable or With block variable not set." error at the line indicated and don't understand why.
Do I need to "set" the .SignerSignature variable somewhere? if so, where?
Thank you.
Bookmarks