Using usingObject = New System.ServiceModel.OperationContextScope(loMyService.InnerChannel) loSOAPSVC.oOperationContextScope = usingObject . . end usingI've tried this that compiles :
Public Sub testExcel4() Dim testobject As New Class1 Debug.Print(Threading.Thread.CurrentThread.CurrentCulture.DisplayName) Using testobject.o = New clsExcel Debug.Print(Threading.Thread.CurrentThread.CurrentCulture.DisplayName) End Using Debug.Print(Threading.Thread.CurrentThread.CurrentCulture.DisplayName) End Subbreaks at runtime with the "Additional information: Operator '=' is not defined for 'Nothing' and type 'clsExcel'." error.
>>Using loSOAPSVC.oOperationContextScope as New System.ServiceModel.OperationContextScope(loMyService.InnerChannel) >>>>
Dim a as New (x) >Dim a = New(x)But would only work in older version if Option Strict was Off.