VBA von VB.NET erzeugen
VB.NET
Public Structure TEapiNotifyParams
Public Msg As Int32 ' message used to return result
Public Handle As IntPtr ' main application handle, used to send return result;
End Structure
Declare Function Start Lib "Eapi.dll" _
Alias "Start" (ByVal SystemNotifyParams As TEapiNotifyParams, _
ByVal BaseCurrencyId As Integer, _
ByVal SLogin As String, _
ByVal SPassword As String, _
ByVal SSystemUrl As String) As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _
Button1.Click
Try
Dim params As TEapiNotifyParams = New TEapiNotifyParams
params.Msg = EapiConstants.WM_EAPI_START_COMPLETED
params.Handle = Me.Handle
Dim url As String = New String(TextBox1.Text)
Dim login As String = New String(TextBox2.Text)
Dim pass As String = New String(TextBox3.Text)
Dim BaseCurr As Integer = Integer.Parse(TextBox5.Text)
Dim result As Integer = EapiTestImport.Start(params, BaseCurr, login, pass, url)
End Try
End Sub
Nun möchte ich den Code unter Excel/VBA laufen lassen, wobei ich Probleme mit "Public Handle As IntPtr" von TEapiNotifyParams und mit "params.Handle = Me.Handle" habe.Wie lautet der entsprechende Code, damit ich ihn unter Excel laufen lassen kann? Dabei möchte ich jedoch keine Forms verwenden, sondern direkt aus Excel heraus den Code starten.
Besten Dank im Voraus.
Grüße
Peter