modeless forms

Hi All,

I'm trying to get my head around modeless forms

In my bit of code I have

Public swApp As SldWorks.SldWorks
Public Model As SldWorks.ModelDoc2

Sub main()

    Set swApp = CreateObject("SldWorks.Application")
    Set Model = swApp.ActiveDoc

     Dialog1.Show vbModeless

End Sub

The form "Dialog1" has the following code for activate

Private Sub UserForm_Activate()

     Dialog1.Text_part.Text = Model.GetTitle

End Sub

If I open the form as model, everything works as expected, if I open the form as Modeless I get " Object variable or with block variable not set" as though the Model object is not availabe

Cheers

Craig

SolidworksApi macros