title: VBA SysCmd Compile error (Sub or Function not defined)
body: <p>I am new to developing code for VBA, I am working on function that runs from an Excel document, the objective is to upload files to sharepoint passing the user credentials, when I compile it I error on SysCmd (Sub or Function not defined), please advice... thanks in advance.</p>
  
  <p>The function is triggered from Excel,</p>
  
  <pre><code>Public Sub CopyToSharePoint()
  
  On Error GoTo err_Copy
  
      Dim xmlhttp
  Dim sharepointUrl
  Dim sharepointFileName
  Dim tsIn
  Dim sBody
  Dim LobjXML As Object
  Dim UserName As String
  Dim pw As String
  Dim RetVal
  Dim i As Integer
  Dim TotFiles As Integer
  Dim Start As Date, Finish As Date
  Dim fso As Object
  Set fso = CreateObject("Scripting.FileSystemObject")
  Dim fldr As Object 'Folder
  Dim f As Object 'File
  
  Set fldr = fso.GetFolder("c:\vba2sharepoint\")
  
  UserName = "mysharepointusername@domain.com" 
  pw = "mysharepointpassword" 
  sharepointUrl = "https://mysite.sharepoint.com/sites/xyz-uat/_layouts/15/start.aspx#/a1docsuat/"
  
  Set LobjXML = CreateObject("Microsoft.XMLHTTP")
  
  TotFiles = fldr.Files.Count
  
  For Each f In fldr.Files
  
   sharepointFileName = sharepointUrl &amp; f.Name
  
      Set tsIn = f.OpenAsTextStream
      sBody = tsIn.ReadAll
      tsIn.Close
  
      Set xmlhttp = CreateObject("MSXML2.XMLHTTP.6.0")
  
      xmlhttp.Open "PUT", sharepointFileName, False, UserName, pw
  
      xmlhttp.Send sBody
  
    i = i + 1
  
    RetVal = SysCmd(acSysCmdSetStatus, "File " &amp; i &amp; " of " &amp; TotFiles &amp; " copied...")
  
  Next f
  
     RetVal = SysCmd(acSysCmdClearStatus)
  
    Set LobjXML = Nothing
  
    Set fso = Nothing
  
  err_Copy:
  
  MsgBox Err &amp; " " &amp; Err.Description
  
  If Err &lt;&gt; 0 Then
    MsgBox Err &amp; " " &amp; Err.Description
    Resume Next
  End If
  
  End Sub
  </code></pre>