I have converted a working C# class that embeds xls files to windows forms application to vb.
I am getting the error:
“Overload resolution Failed because no accessible’Navigate’ accepts this number of arguments”
at the following line:
from:
this.WebBrowserExcel.Navigated+=new System.Windows.Forms.WebBrowserNavigatedEventHandler(this.OnWebBrowserExcelNavigated);
to:
Me.WebBrowserExcel.Navigate += New System.Windows.Forms.WebBrowserNavigatedEventHandler(AddressOf Me.OnWebBrowserExcelNavigated)
i have also tried:
Me.WebBrowserExcel.Navigate += New System.Windows.Forms.WebBrowserNavigatedEventHandler(Me.OnWebBrowserExcelNavigated)
but i get error:
Error 13 Delegate ‘System.Windows.Forms.WebBrowserNavigatedEventHandler’ requires an ‘AddressOf’ expression or lambda expression as the only argument to its constructor.
any ideas?
thanks in advance.
The direct translation of C#’s
delegate +=isAddHandlerin VB:Alternatively, you could do it the VB.NET way and use WithEvents and the Handles Clause: