title: What arguments does UpdateListItems take when calling Sharepoint web service from VBA?
body: <p>I'm trying to add an item to a Sharepoint list using VBA.  I don't want the user to have to install anything, so I'm just using Microsoft Soap Type Library.  Code as follows:</p>
  
  <pre><code>Sub test()
  
  Dim soap As MSSOAPLib.SoapClient
  Dim XMLstr As String
  Dim listid As String
  Dim listname As String
  
  Set soap = New SoapClient
  Call soap.mssoapinit(bstrwsdlfile:="http://wss/mySharepointSite/_vti_bin/lists.asmx?wsdl")
  
  
  listid = "{e285aa1a-my-list-ID-d446cdbf091e}"
  listname = "thisList"
  
  XMLstr = "&lt;Method ID='1' Cmd='New'&gt;" &amp; _
              "&lt;Field Name='ID'&gt;New&lt;/Field&gt;" &amp; _
              "&lt;Field Name='personID'&gt;1337&lt;/Field&gt;" &amp; _
          "&lt;/Method&gt;"
  
  soap.UpdateListItems listid, XMLstr
  
  End Sub
  </code></pre>
  
  <p>I keep getting a "Type Mismatch" error on the <code>soap.UpdateListItems</code> line, regardless of whether I use <code>listid</code> or <code>listname</code> as the first parameter.  I tried reading the WSDL to determine what type of parameter should be passed, but I don't understand it.  What should I be passing here?</p>
  
  <p>EDIT: I got it to work by using Microsoft Soap Type Library 3.0 instead, changing <code>MSSOAPLib.SoapClient</code>-><code>MSSOAPLib30.SoapClient30</code> and <code>bstrwsdlfile</code>-><code>par_wsdlfile</code>, and surrounding <code>XMLstr</code> with:</p>
  
  <pre><code>&lt;Batch OnError='continue' ListVersion='1' ViewName='" &amp; ListView &amp; "'&gt;
  
  ...
  
  &lt;/Batch&gt;
  </code></pre>
  
  <p>Still trying to work out a way to do this without requiring users to install MSSoap 3.0.</p>