Thanks Fry,
I have to use HTTP XMLA, I can not use domain accounts.
I already saw this web page, but everything on it is talking about domain accounts.
https://www.ibm.com/docs/en/cognos-analytics/12.0.0?topic=types-microsoft-analysis-services-data-sources
I am thinking that basic authentication is not possible. Cognos is only using domain accounts.
I have tried to connect anonymously to Cognos, but that also failed, with the same error message.
It seems that anonymous access is not possible from the Excel, either.