vba 2007 sharepoint 2007 - update sharepoint list


New Member
Oct 13, 2014
Hi -

I have been attempting to update a sharepoint list using vba 2007. I have attempted the following:
  • using SQL to treat the list like a database table (using connection strings - per SharePoint connection strings - ConnectionStrings.com). With this method I can write to an Access database that has the sharepoint list linked, but my users do not have MSAccess installed, and thus, the solution does not work for them.
  • using soap/xml, but don't really understand it (the code is at end of this message).
  • am considering direct access to opening windows and filling out forms, but don't have the access rights to install new tools on my development system (I know, so unfair)
So I have a couple questions:
  1. is there some sample code available that I could test?
  2. is there a way to see if I just don't have access rights to add to the list using vba? Our IT dept (I'm separated from them, in Engineering) has restricted direct code access to SharePoint somehow, but I cannot tell how far the restriction has gone.

Suzanne (desparate):rolleyes:

Sub UpdateListDescrption()
' Just activate first sheet for later usage of the cell values
Dim sURL As String
Dim sEnv As String
Dim xmlhtp As New MSXML2.XMLHTTP
Dim xmlDoc As New DOMDocument
' Change HERE and update your SharePoint url
sURL = "http://dev.rainerj.local/sites/ee/_vti_bin/lists.asmx"
sEnv = "<?xml version=""1.0"" encoding=""utf-8""?>"
sEnv = sEnv & "<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""XML Schema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">"
sEnv = sEnv & " <soap:Body>"
sEnv = sEnv & " <UpdateList xmlns=""http://schemas.microsoft.com/sharepoint/soap/"">"
sEnv = sEnv & " <listName>" & Range("A2").Value & "</listName>"
sEnv = sEnv & " <listProperties><List Description=""" & Range("B2").Value & """/></listProperties>"
sEnv = sEnv & " </UpdateList>"
sEnv = sEnv & " </soap:Body>"
sEnv = sEnv & "</soap:Envelope>"

With xmlhtp
.Open "post", sURL, False
.setRequestHeader "Host", "dev.rainerj.local"
.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
.setRequestHeader "soapAction", "http://schemas.microsoft.com/sharepoint/soap/UpdateList"
.send sEnv
MsgBox .responseText
'xmlDoc.Save "D:\RainerJ\EE\WebQueryResult.xml"
End With
End Sub

Forum statistics

Latest member

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...