Live-Forum - Die aktuellen Beiträge
Datum
Titel
24.04.2024 19:29:30
24.04.2024 18:49:56
Anzeige
Archiv - Navigation
1492to1496
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

Report aus IE generieren über VBA

Report aus IE generieren über VBA
12.05.2016 09:58:23
Joshua
Hi all,
please find attached my code.
The code allows me to access and login to an internal database, where I now want to create a Report in .xls-file format (Button is available but without id/name to access).
Have you any ideas on how I can access this button ? I uploaded a screen of the HTML code below.
Code:
' Add reference to Microsoft Internet Controls (SHDocVw)
' Add reference to Microsoft HTML Object Library
Sub InternetExplorerSteuern()
Dim IEApp As Object
Dim IEDocument As Object
Dim doc As MSHTML.HTMLDocument
Dim div As HTMLDivElement
Set IEApp = GetObject("new:{D5E8041D-920F-45e9-B8FB-B1DEB82C6E5E}")
IEApp.Visible = True
IEApp.Navigate "Browser-page"
Do: Loop Until IEApp.Busy = False
Set IEDocument = IEApp.document
IEDocument.getElementById("sap-user").Value = "user-name"
IEDocument.getElementById("sap-password").Value = "password"
IEDocument.getElementById("b1").Click
IE.document.parentWindow.execScript "Launch Tracker U8 / MaxLines: 100(document.Click);"
Do: Loop Until IEDocument.ReadyState = "complete"
End Sub

Screen:
Userbild
with Button-properties
Best Wishes
Joshua

3
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: Report aus IE generieren über VBA
12.05.2016 10:17:03
Martin
Hi Joshua,
please try that:
IEDocument.parentWindow.execScript "LokAction('52');"
best reards
Martin

AW: Report aus IE generieren über VBA
12.05.2016 10:39:27
Joshua
Hi Martin,
thank you for your contribution, but that seems to doesn't work at all.
Do you think it could be possible that the problem has something to do with the not existing waiting-time until the webpage is fully loaded ?(before executing the command)
Regards
Joshua

AW: Report aus IE generieren über VBA
12.05.2016 11:02:49
Martin
Hi Joshua,
Okay, next try:
Sub InternetExplorerSteuern()
Dim IEApp As Object
Set IEApp = GetObject("new:{D5E8041D-920F-45e9-B8FB-B1DEB82C6E5E}")
IEApp.Visible = True
IEApp.Navigate "Browser-page"
Do: Loop Until IEApp.Busy = False
With IEApp.document
.getElementById("sap-user").Value = "user-name"
.getElementById("sap-password").Value = "password"
.getElementById("b1").Click
Do: Loop Until .ReadyState = "complete"
.parentWindow.execScript "LokAction('52');"
End With
End Sub
best regards
Martin
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige