Bis jetzt habe ich mit den unten aufgeführten Makro meine Excel Daten in den Internet Explorer eingefügt.
Jetzt habe ich dasProblem das der Link sich je nach Session ändert. Jetzt funktioniert das natürlich nicht mehr :-(
Kann ich den IE auch mit Daten befülle wo ich nicht den Link vorher kenne?
Sub b()
Dim objShell As Object
Dim IEApp As Object, win As Object
Dim adresse As String
adresse = "http://www.*****.de/auswahl.php" 'anpassen
Set objShell = CreateObject("Shell.Application")
For Each win In objShell.Windows
If InStr(1, UCase(win.FullName), "IEXPLORE") > 0 Then
If win.Document.Location = adresse Then
Set IEApp = win
Exit For
End If
End If
Next
If IEApp Is Nothing Then
Set IEApp = CreateObject("InternetExplorer.Application")
IEApp.Visible = True
IEApp.Navigate adresse
Do: Loop Until IEApp.Busy = False
Do: Loop Until IEApp.Busy = False
End If
Set IEDocument = IEApp.Document
Do: Loop Until IEDocument.ReadyState = "complete"
IEDocument.getElementById("anrede").Value = "Herr"
IEDocument.getElementById("vorname").Value = "Sebastian"
IEDocument.getElementById("name").Value = "lupo"
Set IEDocument = Nothing
Set IEApp = Nothing
Set objShell = Nothing
End
Sub