[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 433
  • Last Modified:

Visual Basic 6.0 - Run-time error '424 Object Required

I have a Form that is calling a function from a class.
I placed the name of the Class followed by the function name like this.
Class.FunctionName and it give me the 424 error.  I also tried placing a variable inside parenthesis, but it did not help.

0
GarySB
Asked:
GarySB
  • 12
  • 4
  • 3
  • +2
1 Solution
 
käµfm³d 👽Commented:
Have you tried something along the lines of:
Dim obj As ClassName

Set obj = New ClassName

obj.FunctionName

Open in new window

0
 
GarySBAuthor Commented:
The obj in the dim and set, they are both local in the procedure right?
0
 
GarySBAuthor Commented:
I tried what you said, and it is now giving me:
Method or data member not found

I tried adding obj.classname.FunctionName

What next?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
käµfm³d 👽Commented:
Is the function marked "Public"?
0
 
käµfm³d 👽Commented:
Is the function marked "Public"?
By this I am referring to the definition of the function in the class definition.
0
 
judgekingCommented:
Can you post some of you code?
0
 
judgekingCommented:
Gary, any update?
0
 
judgekingCommented:
Gary, any update?
0
 
judgekingCommented:
Gary, any update?
0
 
mlmccCommented:
I've requested that this question be deleted for the following reason:

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
 
GarySBAuthor Commented:
Sorry for the delay.  I was not programming for sometime, but am able to continue now.  Please allow the question to proceed.  I will double the points, Thank You
0
 
GarySBAuthor Commented:
The function is marked private.
0
 
GarySBAuthor Commented:
This is the code:

Private Sub MenuFileUpdate_Click

   Dim tmpLessons as Lessons
   Set tempLessons = New Lessons
   Set XE = New WebLock
   WebLock.WebGetList

End Sub
0
 
GarySBAuthor Commented:
Just raised the points
0
 
mlmccCommented:
If you are trying to access the function outside the class or form it has to be PUBLIC

If it is private it is only available to the form or inside the class.

mlmcc
0
 
GarySBAuthor Commented:
What would you suggest in order for me to call this function from my module without compromising the security?  Is it a real difference between the public & private.  In other words is that compromising the security of my program if the function is made public?
0
 
GarySBAuthor Commented:
Cant the class be included somehow so the class knows that calls from my  modules are allowed?
0
 
GarySBAuthor Commented:
I meant module be included in the class.
0
 
GarySBAuthor Commented:
OK, I tried making the function Public and it gave me the same error, so what now?
0
 
mlmccCommented:
Are Lessons and WebLock aslso private?

mlmcc
0
 
GarySBAuthor Commented:
WebLock is the name of my class.

These are really the only lines from my program that i was using.  I only added the dim above as a possible solution, but it did not work.
 Set XE = New WebLock
 WebLock.WebGetList

0
 
GrahamSkanCommented:
Try

Set XE = New WebLock
 XE.WebGetList
0
 
GarySBAuthor Commented:
This solution in my vb module worked once I made the function in the class Public.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 12
  • 4
  • 3
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now