Solved

ERROR 91

Posted on 2002-05-24
15
204 Views
Last Modified: 2013-11-13
I am getting an error 91 whenever i assaign one of the values in my object. the property has let/get and does not use set. here is what I get the error on

myclsdeclare.server="www.apex2000.net"

Is there something that I am doing wrong or what?
0
Comment
Question by:sk33v3
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
  • 4
15 Comments
 
LVL 4

Expert Comment

by:gencross
ID: 7032679
I assume your object is Dimmed and Set.

Have you tried using the Set key word to set the property?  You could get this error on certain properties depending on what type it is if you do not use Set.

Set myclsdeclare.server = "www.apex2000.net"

Hope this helps.


0
 
LVL 4

Expert Comment

by:gencross
ID: 7032688
BTW, what datatype or object is the server property?
0
 
LVL 9

Author Comment

by:sk33v3
ID: 7032700
Server is a string. and I tried to use set and I just get a different error.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 9

Author Comment

by:sk33v3
ID: 7032707
Invlaid use of property.
0
 
LVL 4

Expert Comment

by:gencross
ID: 7032731
Please post the code for the Dim and Set and I will take a look at it.
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 7032928
Can you:

debug.print myclsdeclare.server

? If not, the problem is likely in your declaration of myclsdeclare.  Otherwise, there should be no reason that you can't assign a string to a string property...unless there's other code in the class definition's code...post the code for

Public Property Let Server(...
' is code doing something to generate a 91 error?
End Property
0
 
LVL 9

Author Comment

by:sk33v3
ID: 7033002
This is what is in the class

Private m_varServer as string

public property get Server() as string
     server= m_varServer
end property

public property let Server(NewValue as string)
     m_varServer = NewValue
end property

this is how i am calling it

myclsdeclare.server="www.apex2000.net"
0
 
LVL 4

Accepted Solution

by:
gencross earned 50 total points
ID: 7033029
Where are you setting myclsdeclare?
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 7033032
I just added a new class, Class1:

Private m_varServer As String

Public Property Get Server() As String
    Server = m_varServer
End Property

Public Property Let Server(NewValue As String)
    m_varServer = NewValue
End Property

...
then added this code to a procedure:

  Dim cls As Class1
  Set cls = New Class1
  cls.Server = "www.apex2000.net"
  Set cls = Nothing

and had no problems.
-------------------

Is it possible that you have another reference that's overriding the property?  What other references are in the project?
0
 
LVL 9

Author Comment

by:sk33v3
ID: 7033329
The only thing that i see that has anything to do with the with blocks is that i do have a winsock control setup with events is there anything special i am supposed to do with that?
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 7033441
At this point, I don't see anything that would cause this problem.  Let me suggest that you create a new project, add the class, and try the same set statements to see if the problem still exists.  If so, the problem is likely to be in the class...somehow...(although it might also be somewhere in the Windows configuration.) If not, the problem is obviously in the original project.
0
 
LVL 9

Author Comment

by:sk33v3
ID: 7034071
ok thanks for all of your help. Let me try that.
0
 
LVL 9

Author Comment

by:sk33v3
ID: 7058027
I figured it out. I hadn't set it as a new object. That was stupid of me. thanks for the help
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 7058038
Did my 5/24 11:24am comment help (which included this line: Set cls = New Class1)?

If so, select that as your answer.  If not, determine which comment best got you in the right direction and select that.
0
 
LVL 9

Author Comment

by:sk33v3
ID: 7058039
Sorry i hadn't read this post.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question