He encontrado como hacerlo desde vba. El usuario y clave se pasan utilizando ActiveSheet.PostText, pero no consigo hacerlo funcionar....
Código:
Sub ConsultaWeb()
'
' ConsultaWeb Macro
'
'
Const user = "mi usuario"
Const pass = "mi clave"
For Each Q In ActiveSheet.QueryTables
Q.Delete
Next Q
ActiveSheet.Cells.Clear
With ActiveSheet.QueryTables.Add(Connection:="URL;http://www.miwebdelogueo.com/index.jsp", Destination:=Range("$A$1"))
.PostText = "user=" & user & "&pass=" & pass
.Refresh BackgroundQuery:=False
.Connection = "URL;http://www.miwebconlosdatos.com/datos.jsp"
.Name = "datos.jsp"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 60
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
Range("A2").Select
End Sub