Tuesday, November 22, 2011

Excel Macros, VB Script and HTTP Basic Authentication

I came across an Excel sheet that retrieve data from a web site by calling a URL using a macro (VB Script). The site was using basic authentication and the macro wasn't working since it was not sending the user credentials in the request header. I haven't worked with Excel Macros or VB Script so turned to Google for some help.

Didn't find anything that was working but found some half answers which I managed to cobble together to get a working solution. Thought I would write it down here for anyone trying to do the same in future.



Base64Encoding function copied from here and

Don' forget to click the +1 button below if this post was helpful.

0 comments: