[CONNECT U15 VB] Application Events OnDesignFileOpened and OnDesignFileClosed cannont be found

I am upgrading a program from V8i to CONNECT Update 15.  The V8i code had an instance of the Application class declared as follows:

Private WithEvents msApp As Bentley.Interop.MicroStationDGN.Application = Nothing

And thencode to handle the OnDesignFileOpened event:

Public Sub DesignFileOpened(ByVal Filename As String) Handles msApp.OnDesignFileOpened

This works in v8i.  In CONNECT I get the following error:

Error    BC30590    Event 'OnDesignFileOpened' cannot be found.

Can someone tell me how to upgrade this or what I am doing wrong?

Thanks,

Warren

Parents
  • Event 'OnDesignFileOpened' cannot be found

    If you create a VBA macro, does that compile OK?

    Dim WithEvents hooks As Application
    
        Private Sub Class_Initialize()
            Set hooks = Application
        End Sub
        Private Sub hooks_OnDesignFileClosed(ByVal DesignFileName As String)
            Debug.Print "Closed design file " & DesignFileName
        End Sub
    
        Private Sub hooks_OnDesignFileOpened(ByVal DesignFileName As String)
            Debug.Print "Opened design file " & DesignFileName
        End Sub

     
    Regards, Jon Summers
    LA Solutions

Reply
  • Event 'OnDesignFileOpened' cannot be found

    If you create a VBA macro, does that compile OK?

    Dim WithEvents hooks As Application
    
        Private Sub Class_Initialize()
            Set hooks = Application
        End Sub
        Private Sub hooks_OnDesignFileClosed(ByVal DesignFileName As String)
            Debug.Print "Closed design file " & DesignFileName
        End Sub
    
        Private Sub hooks_OnDesignFileOpened(ByVal DesignFileName As String)
            Debug.Print "Opened design file " & DesignFileName
        End Sub

     
    Regards, Jon Summers
    LA Solutions

Children