Code: Alles auswählen.
Dim XMLhttp: Set XMLhttp = CreateObject("msxml2.xmlhttp")
Dim response As String
Dim strURL As String: strURL = "http://meinSapServer:80XX/sap/bc/bsp/sap/meineBSPSeite"
XMLhttp.Open "GET", strURL, False
XMLhttp.setRequestHeader "Authorization", "Basic <BASE64-Code für Username:Passwort>"
XMLhttp.send ""
response = XMLhttp.responseText
MsgBox XMLhttp.Status & " " & XMLhttp.statusText
MsgBox response
Code: Alles auswählen.
var xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", UrlWieInExcel, false );
xmlHttp.setRequestHeader("Authorization", "Basic " + <BASE64-Code für Username:Passwort>);
try {
xmlHttp.send( "" ); ##### --> FEHLER! #####
} catch(err) {
alert(err);
}
return xmlHttp.responseText;
Code: Alles auswählen.
var xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", UrlWieInExcel, false );
xmlHttp.setRequestHeader("Authorization", "Basic " + <BASE64-Code für Username:Passwort>);
var response;
xmlHttp.addEventListener('load', function(event) {
if (xmlHttp.status >= 200 && xmlHttp.status < 300) {
console.log(xmlHttp.responseText);
response = xmlHttp.responseText;
} else {
console.warn(xmlHttp.statusText, xmlHttp.responseText);
}
});
xmlHttp.send();
return response;