Sharepoint 2010: xmlhttp PUT in VBA denied with valid credentials

Posted on 2011-02-22
Last Modified: 2012-06-27
In an Access application the following VBA instructions return error 401 (Unauthorized) where UserName and pw represent valid credentials:
xmlhttp.Open "PUT", sharepointFileName, False, UserName, pw
xmlhttp.Send sBody
MsgBox xmlhttp.Status
Does anybody know what could be causing this?
Question by:dgmoore1
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 28

Expert Comment

ID: 34954467
Just taking a stab at this since I don't work with Sharepoint at all...but what happens if you leave off the username and pass?
xmlhttp.Open "PUT", sharepointFileName, False

If you receive a prompt for username and password from the Sharepoint site then it suggests a problem with either the username or password in the variables you are using.  If you still receive the 401 error, however, it suggests a problem witht he URL in the sharepointFileName variable.

OM Gang
LVL 83

Expert Comment

by:Dave Baldwin
ID: 34954469
At the bottom of this page, it says that credentials are not automatically sent to the server....

Accepted Solution

dgmoore1 earned 0 total points
ID: 34955400
I found the problem - the credentials passed must include the domain. I prepended the domain to the username and everything clicked.
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

LVL 83

Expert Comment

by:Dave Baldwin
ID: 34955425
Cool, glad you got it.

Author Comment

ID: 34955895
I've done this before in other Sharepoint environments and it wasn't necessary to supply the domain name, so this one had me stymied.
LVL 83

Expert Comment

by:Dave Baldwin
ID: 34956214
Well, you know they keep changing things...

Author Comment

ID: 34956532
...and not telling anybody!

Author Closing Comment

ID: 34990852
Found the solution myself

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question