We made big effort for many years of development to make our VBcode Strict On
. It's efficient and we try to stick to this. However now we integrated it with external dll
working as COM object
. And we are not able to keep option strict on anymore, is there any way round?
Code:
Option Strict On
Public COMOBJECT As Object 'define variable as Object
COMOBJECT = CreateObject(CLSID) 'dispatch COM server
COMOBJECT.OpenFile 'do whatever dll registered as com exposes
COMOBJECT.SaveFile 'it all works with Option Strint Off
COMOBJECT.dowhatever 'but not with Strict On
Error: Option Strict On disallows late binding.
Is there a way we can keep option strict On