I have written a shared module. I used a .net reference (Mindfusion.Diagramming.WPF.dll)inside of that shared script.

When calling shared module to other test script, it's working someplace but in some scripts I am getting "Type Mismatch" error on that shared module.

I tried with add same reference in test script. But i m getting same error.

Can anybody suggest me why this type of error I am getting. What is the solution?

here is sample code

'Shared module
Public Sub ExpandToolbar()
Dim TB As NavigationBar

WPFWindow("Application=Test.EXE Caption='Test Application'").Attach

'Here getting type mismatch error
Set TB = WPFControl("Name=navBar").Object

'Check Whether Palette Toolbar is expanded or not
If TB.IsMinimized = True Then
TB.IsMinimized = False
End If
Set TB = Nothing

End Sub


When i call ExpandToolbar function to other scripts, some places it's working but some places it's not working.