Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Word Newsgroups
Word VBA
More On Class
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Greg Maxey, post: 5853382"] Jonathan, Sometimes I just hate this stuff gggrrrr. After struggling for nearly two hours, I simply can't get the grasp of Propert Set. I wanted to try to incorporate a LBound and UBound property of the class. I had no trouble using LET and GET statements, but keep get a compile error any time I try to use the SET statement. I created a new class modules "clsUnderstandingSet" with this code: Option Explicit Private mUBound As Long Private mLBound As Long Private mModuleObject As Object Property Get lngUBound() As Long lngUBound = mUBound End Property Property Let lngUBound(pVal As Long) mUBound = pVal End Property Property Get lngLBound() As Long lngLBound = mLBound End Property 'Property Set lngLBound(pVal As Long) ' Set mLBound = pVal 'End Property Private Sub Class_Initialize() Dim pVal As Long Dim pObject As Object pVal = 6 'Set Me.lngLBound = pVal Set Me.MyObject = New Word.Application Set pObject = Me.MyObject End Sub Public Property Get MyObject() As Object Set MyObject = mModuleObject End Property Public Property Set MyObject(NewValue As Object) Set mModuleObject = NewValue End Property and a calling macro with this code: Sub TestClass() Dim myTest As clsUnderstandingSet Set myTest = New clsUnderstandingSet myTest.lngUBound = 10 MsgBox myTest.lngLBound & " and " & myTest.lngUBound End Sub The stetted out statements in the Class module are what is giving me fits. You can run the code as is and see that the UBound property is "LET" to 10, and I copied a working SET statement from Google to set the MyOject variable, but I can't get SET to work to set the LBound variable. What am I doing wrong?? [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Word Newsgroups
Word VBA
More On Class
Top