Currently developing my first somewhat tricky spreadsheet application and I'm getting an error 91 which doesn't seem to bear any resemblance to anything google will find.
I'm still pretty new to the whole visual basic thing and find the syntax a little alien (doesn't help if one is used to java)
I define the variable of type declared by class module
I create a new instance and put that in the variable
I attempt to set a property of the instance and get an error.
I have my main subroutine (in a form) that throws the error
And the class module that I'm referring too
I'm still pretty new to the whole visual basic thing and find the syntax a little alien (doesn't help if one is used to java)
I define the variable of type declared by class module
I create a new instance and put that in the variable
I attempt to set a property of the instance and get an error.
I have my main subroutine (in a form) that throws the error
Code:
'dim SettingsRef as RefEdit ' from form editor
Option Explicit
Private Sub ApplyButton_Click()
Dim a As Range
Set a = Range(SettingsRef) ' This line runs no problem...
Dim universe As ConwayUniverse
Set universe = New ConwayUniverse
' universe is NOT nothing
' Range(...) evaluates without error
universe.SettingsRef = Range(SettingsRef) 'I get error 91 on this
Let universe.SettingsRef = Range(SettingsRef) 'I get error 91 on this line too
'Set universe.SettingsRef = Range(SettingsRef) 'I'd get a compiler error with this
End Sub
And the class module that I'm referring too
Code:
Option Explicit
Private SettingsP As Range ' top left cell of settings block
Public Property Get SettingsRef() As Range
SettingsRef = Settings(0, 0)
End Property
Public Property Get Settings(row As Integer, col As Integer) As Range
Settings = SettingsP.Offset(row, col)
End Property
Public Property Let SettingsRef(val As Range)
SettingsP = val
End Property