Re: Reproducable Hard Crash in Excel 2003 (and earlier versions) with the following VBA code.

From: David Battams (davbat88_at_hotmail.com)
Date: 06/25/04


Date: Fri, 25 Jun 2004 12:41:30 -0400

Hi again Jamie,

Tried the VB object route - here's my 2 second class:

Class Module FailedPattern

Private m_patternLabel As String
Private m_reason As String

Public Property Get PatternLabel() As String
    PatternLabel = m_patternLabel
End Property

Public Property Let PatternLabel(ByVal label As String)
    m_patternLabel = label
End Property

Public Property Get Reason() As String
    Reason = m_reason
End Property

Public Property Let Reason(ByVal reason As String)
    m_reason = reason
End Property

to replace the following data type:

Public Type FAILED_PATTERN
    patternLabel As String
    reason As String
End Type

but just like the with the data type I still got the hard crash in Excel :-(

Something for Microsoft I guess......

Regards,
Wayne.

"David Battams" <davbat88@hotmail.com> wrote in message
news:epOS99sWEHA.2852@TK2MSFTNGP12.phx.gbl...
> Hi Jamie,
>
> My comment about the UserForm being an object module was that there is no
> need to "pretend" its like an object module since it is one. Rob is using
it
> correctly It's just a special type of class module.
>
> I might try the idea of using a class object in lieu of a type and let you
> know how it goes. I am writing VBA code against a set of custom COM
> components, but the data type I am having the problem with is used purely
> within the VBA world, so I have the freedom to change it to a VBA class
> instead. Good thinking and I'll let you know how it goes.
>
> Cheers,
> Wayne.
>
>
>
>
> "Jamie Collins" <jamiecollins@xsmail.com> wrote in message
> news:2ed66b75.0406250149.4b3201b6@posting.google.com...
> > "David Battams" wrote ...
> >
> > > There's no "treating" a UserForm class as an object module. It IS an
> object
> > > module.
> >
> > I think Rob meant he uses a userform as he would a class e.g. add
> > public members to the userform rather than use public variables in a
> > standard module etc.
> >
> > > KeepItCool - what do you mean what is the point? I presume hard
crashes
> are
> > > a feature in your code? :-)
> >
> > I think KeepItCool meant he usually instantiates a userform with
> >
> > Load UserForm1
> >
> > (which is reasonable if you only need one instance) and wasn't waare
> > he could you could do the same with
> >
> > Dim frm1 As UserForm1
> > Set frm1 = New UserForm1
> >
> > David, untested but if you replace the struct (MY_DATA_TYPE) with a
> > complex object (a VB class) I think the problem would go away. That's
> > what I mean by the struct being the problem. But something tells me
> > you need the struct for an external app...?
> >
> > Jamie.
> >
> > --
>
>



Relevant Pages


Loading