runtime error 91 by passing a value between modules

C

christian_fandel

Hello,

I want to set a Flag being passed from "ThisWorkbook" to "Table1" by
purpose. I use following code:

'## Thisworkbook
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)
Dim tPl As Table1

If Sh.Name = SHEETTP Then
tPl.tblChanged = True '<<<< here occurs the error
End If

End Sub

'## Table1:

Private m_tblChanged
Public Property Get tblChanged() As Boolean
tblChanged = m_tblChanged
End Property
Public Property Let tblChanged(ByVal setFlag As Boolean)
m_tblChanged = setFlag
End Property

private sub cmdDoSomething_click()
action
me.tblChanged=False
end sub

Any hint ?? thanx a lot!!

Christian
 
B

Bob Phillips

What is Table1? The name of a module, a class name or what?

Maybe you want.

## Thisworkbook
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)
Dim tPl As Table1

Set tP1 = New Table1

If Sh.Name = SHEETTP Then
tPl.tblChanged = True '<<<< here occurs the error
End If

End Sub



--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
C

christian_fandel

Hi Bob,
What is Table1? The name of a module, a class name or what?

Thats the name of the sheet to be monitored as displayed in VBA-
Project under Micro$oft Excel objects

Set tP1 = New Table1

runs into "incorrect use of New"

Any ideas left ?

BR
Christian
 
B

Bob Phillips

Yeah.

Change

Private m_tblChanged

to

Public m_tblChanged

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top