

If e.Status = WebExceptionStatus.ProtocolError Thenį = & "Error-Status Code: " & CType(e.Response, HttpWebResponse).StatusCode & vbCrLfį = & "Error-Status Description: " & CType(e.Response, HttpWebResponse).StatusDescription & vbCrLfį = & "Error-Server: " & CType(e.Response, HttpWebResponse).Server & vbCrLfį = & "Error-Exception: " & e.Message & vbCrLfĮrror -WebException: The remote server returned an Error: (400) Bad Request. 'Catch exception if trying to add a restricted header.į = & "Error-ArgumentException: " & e.Message & vbCrLfį = & "Error-WebException: " & e.Message & vbCrLf To make an API call we must go to the Data tab and click on New Query From Other Sources From Web. Previous versions can also make it, but installing the PowerQuery plugin. Looking for Microsoft 365 Support UK call on 0808 164. Excel 2016 has a built-in feature that allows to make API calls.

CALL REST API FROM EXCEL FOR MAC 2018 INSTALL
Add("Authorization", "Bearer ABCDabcd1234=")ĭim myHttpWebResponse As HttpWebResponse = CType(myHttpWebRequest.GetResponse(), HttpWebResponse)į = & myHttpWebResponse.ToString() & vbCrLf See Steps 2 and 3 on the PC or Mac tabs above to help you with the rest of the install process. Public Shared Sub Main()ĭim myHttpWebRequest As HttpWebRequest = CType(WebRequest.Create(), HttpWebRequest) There is a form named form1 which has a txtURL textbox, a button to call sub Main(), and an output textbox called textbox1. The REST API call will go into a Visual Basic Windows Service once I get it working, This is just to get the REST API to work. I have a sample function which I’m calling from a simple forms project. It works fine if I call the REST API from SoapUI.
