folgendes Makro hatte ich aufgezeichnet:
Sub ineteintrag()
Range("A1:N57").Select
With ActiveWorkbook.PublishObjects("Bilanz02-03-VR_22080")
.HtmlType = xlHtmlStatic
.Filename = "h:\ftv1860\bilanz.htm"
.Publish (False)
End With
ChDir "h:\ftv1860\"
ActiveWindow.ScrollRow = 1
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
"http://www.meineseite.de/upload.html"
Selection.Hyperlinks(1).Follow NewWindow:=True, AddHistory:=True
Range("A1:N57").Select
End Sub
Damit wird zwar die Seite aufgerufen, aber das Masswort nicht übergeben...
Von mathias r. habe ich darauf hin folgendes Makro erhalten:
'Verweis (Extras/Verweise) nötig:
'Microsoft Internet Controls (Shdocvw.dll)
Private Sub Browse()
Dim IE As New InternetExplorer
Dim sUser As String
Dim sPassword As String
Dim sLogin As String
Dim sURL As String
sURL = "http://www.meineUploadSeite.de/upload.html"
sUser = "Willi Wichtig"
sPassword = "Geheim"
sLogin = Base64_Encode(sUser & ":" & sPassword)
IE.Visible = True
IE.Navigate URL:=sURL, Headers:="Authorization: Basic " & sLogin & Chr$(13) & Chr$(10)
Set IE = Nothing
End Sub
Public Function Base64_Encode(strSource) As String
Const BASE64_TABLE As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
Dim strTempLine As String
Dim j As Integer
For j = 1 To (Len(strSource) - Len(strSource) Mod 3) Step 3
strTempLine = strTempLine + Mid(BASE64_TABLE, (Asc(Mid(strSource, j, 1)) \ 4) + 1, 1)
strTempLine = strTempLine + Mid(BASE64_TABLE, ((Asc(Mid(strSource, j, 1)) Mod 4) * 16 _
+ Asc(Mid(strSource, j + 1, 1)) \ 16) + 1, 1)
strTempLine = strTempLine + Mid(BASE64_TABLE, ((Asc(Mid(strSource, j + 1, 1)) Mod 16) * 4 _
+ Asc(Mid(strSource, j + 2, 1)) \ 64) + 1, 1)
strTempLine = strTempLine + Mid(BASE64_TABLE, (Asc(Mid(strSource, j + 2, 1)) Mod 64) + 1, 1)
Next j
If Not (Len(strSource) Mod 3) = 0 Then
If (Len(strSource) Mod 3) = 2 Then
strTempLine = strTempLine + Mid(BASE64_TABLE, (Asc(Mid(strSource, j, 1)) \ 4) + 1, 1)
strTempLine = strTempLine + Mid(BASE64_TABLE, (Asc(Mid(strSource, j, 1)) Mod 4) * 16 _
+ Asc(Mid(strSource, j + 1, 1)) \ 16 + 1, 1)
strTempLine = strTempLine + Mid(BASE64_TABLE, (Asc(Mid(strSource, j + 1, 1)) Mod 16) * 4 + 1, 1)
strTempLine = strTempLine & "="
ElseIf (Len(strSource) Mod 3) = 1 Then
strTempLine = strTempLine + Mid(BASE64_TABLE, Asc(Mid(strSource, j, 1)) \ 4 + 1, 1)
strTempLine = strTempLine + Mid(BASE64_TABLE, (Asc(Mid(strSource, j, 1)) Mod 4) * 16 + 1, 1)
strTempLine = strTempLine & "=="
End If
End If
Base64_Encode = strTempLine
End Function
Aber das funktioniert leider auch nicht... denn:
was bedeutet "'Verweis (Extras/Verweise) nötig:
'Microsoft Internet Controls (Shdocvw.dll)"?
Was muss ich tun?
Unter extras finde ich keine "verweise"???
"Dim IE As New InternetExplorer" hier sagt er mir:"benutzerdefinierter typ nicht definiert
Könnt ihr mir nochmals helfen?
Grüße und Dank
Benjamin