How to open a file with http authentication with a macro (conveniently)

I have written a macro to open an xml file which is protected by http authentication in calc -

dim sURL as string 
dim oArgs(0) As New
dim oDocStatus as object
dim oihandler 
oihandler = createUnoService("")
sURL = ""
oArgs(0).Name = "InteractionHandler"
oArgs(0).Value = oihandler
oDocStatus = StarDesktop.loadComponentFromURL(sURL, "_default", 0, oArgs)

This works fine except that each time I run it -

  1. I have to key in my user name / password in an Authentication Required window
  2. I have to click OK on the subsequent “Text Import” window.

How could I improve this macro to avoid repetitively doing these actions?
(removing http authentication from the xml page is not possible)

If it’s a standard http authentication, you can try to add it to the url this way:

I tried that and recieved an error - BASIC runtime error.
An exception occurred
Message: Unsupported URL http://user:pass@

In case anyone has the same question, I have moved the topic to - [Solved] Open a file with http authentication with a macro (View topic) • Apache OpenOffice Community Forum