Dim Start As Date
Dim IEApp As Object
Dim IEDocument As Object
Dim AktuelleZeile, UhrzeitPos As Integer
Dim DatumUhr, Datum, Platz, Auswahltreffen, sQuelltext As String
GStück = Cells(Target.Row, 5)
If GStück > 0 Then
'Start Bedingung: GStück
LinkManuell: 'nach Eintrag x in Spalte 8 IE öffnen
AktuelleZeile = Cells(Target.Row)
Set IEApp = GetObject("new:{D5E8041D-920F-45e9-B8FB-B1DEB82C6E5E}")
'Set IEApp = CreateObject("InternetExplorer.Application")
IEApp.Visible = True
IEApp.navigate "URL" 'anpassen
Start = Now
Do: Loop Until IEApp.Busy = False
Do: Loop Until IEApp.Busy = False
Do: Loop Until IEApp.document.ReadyState = "complete"
Do
'On Error Resume Next
If DateDiff("s", Start, Now) > 0 Then Exit Do
Loop Until IEApp.ReadyState <> 4
Set IEDocument = IEApp.document
IEDocument.all.USER.Value = "Benutzer"
IEDocument.all.PASS.Value = "passwort"
IEDocument.getElementsByName("LoginForm")(0).submit
Do
If DateDiff("s", Start, Now) > 5 Then Exit Do
Loop Until IEApp.ReadyState <> 4
'Formular füllen
IEDocument.all.LINKS.Value = Auswahltreffen
Sheets("Tabelle2").Select
IEDocument.all.Item("links").Focus ("links")
With IEDocument
SendKeys "{UP}", True
End With
Und der Quellcode einmal für die Seite und einmal für den Frame(wenn ich das richtig verstanden habe) in dennen der Link liegt.
<
form
name
=
"StartForm"
action
=
"/beleg/Check.jsp"
method
=
post
width
=
"500"
autocomplete
=
"off"
>
<
center
>
<
table
cellpadding
=
4
cellspacing
=
2
border
=
0
>
<
tr
bgcolor
=
"#c8d8f8"
>
<
td
valign
=
top
colspan
=
2
>
<
b
>Artikel_Nr / Artikel_St</
b
>
<
br
>
<
input
type
=
"text"
name
=
"LINKS"
id
=
"Links"
size
=
"70"
value
=
""
onKeyUp
=
"Auswahl_Links();"
>
</
td
>
</
tr
>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<
html
>
<
head
>
<
meta
http-equiv
=
"Content-Type"
content
=
"text/html; charset=UTF-8"
>
</
head
>
<
script
type
=
"text/javascript"
>
function choose(wert) {
top.document.getElementById("links").value=wert;
parent.absenden("LINKS");
top.document.getElementById("IFRAME").style.visibility = "hidden";
}
function close(){
top.document.getElementById("IFRAME").style.visibility = "hidden";
}
</
script
>
<
body
bgcolor
=
"white"
>
<
span
style
=
"font-family:sans-serif; font-size:12px;"
>
<
table
style
=
"font-size:12px;font-weight:none;"
width
=
"100%"
border
=
"0"
cellspacing
=
"0"
cellpadding
=
"0"
>
<
tr
>
<
td
colspan
=
"2"
align
=
"right"
>
<
a
href
=
"JavaScript:close();"
style
=
"text-decoration:none;color:#000000;font-weight:bolder;"
>X </
a
>
</
td
>
</
tr
>
<
tr
> <
td
colspan
=
'2'
nowrap
=
"nowrap"
> <
a
href
=
"javascript:choose('nichtgewaehlt')"
>Bitte wählen</
a
> </
td
> </
tr
>
<
tr
> <
td
colspan
=
'2'
nowrap
=
"nowrap"
> <
a
href
=
"javascript:choose('Objektnummer, Referenznummer')"
>Objektname</
a
> </
td
> </
tr
>
<
tr
> <
td
colspan
=
'2'
nowrap
=
"nowrap"
> <
a
href
=
"javascript:choose('Objektnummer2, Referenznummer2')"
>Objektname2</
a
> </
td
> </
tr
>
</
table
>
</
span
>
</
body
>
</
html
>