davidd31415
Electrical
- Nov 23, 2001
- 67
I'm trying to return a user-defined class object from a different class function and am getting an "object variable or with block variable not set" error after the object initializes.
I've tried using both Property Get and Functions, both in this form:
Public Function GetDateTime() As DataPointClass
GetDateTime = New DataPointClass
GetDateTime = DateTime
End Function
Where DateTime is a DataPointClass Object. If I leave out the GetDateTime = New DataPointClass line, the same error is raised.
Any ideas how I can do this? I believe in C++ I'd need to use pointers, this is the first time I've ever tried something like this with vBA.
Thanks,
Dave
I've tried using both Property Get and Functions, both in this form:
Public Function GetDateTime() As DataPointClass
GetDateTime = New DataPointClass
GetDateTime = DateTime
End Function
Where DateTime is a DataPointClass Object. If I leave out the GetDateTime = New DataPointClass line, the same error is raised.
Any ideas how I can do this? I believe in C++ I'd need to use pointers, this is the first time I've ever tried something like this with vBA.
Thanks,
Dave