Solutions to common Scriptcontrol problems in VB.NET
I've just converted an application from VB to VB.NET. This application used the scriptcontrol a lot.
In my experience there were the following problems after the upgrade:
1. Everything the scripts can access must be made public, or you will get the "No such Interface supported" error.
2. The scriptcontrol seems to have problems accessing overloaded procedures. This includes collections or dictionaries, where you can use both the col("key") syntax as well as the col(7) syntax.
This second problem can be solved by replacing the "public col as Collection" declaration with the following piece of code:
Private objCol As New Collection
Public Function col(Optional ByVal IndexOrKey As Object = Nothing) As Object
If IndexOrKey Is Nothing Then
Return objCol
Else
Return objCol(IndexOrKey)
End If
End Function