I am new to developing code for VBA, I am working on the function that runs with Excel document, The purpose is to upload the user credentials to pass the files SharePhase, when I compile it I error on SysCmd (not defined sub or function), please advise ... Thanks in advance.
is triggered by function Excel,
public sub CopyToSharePoint () Error Goto err_Copy dim xmlhttp dim sharepointUrl dim sharepointFileName object as dim Tsin dim sBody dim LobjXML dim username string dim as PW string dim retval dim as I rounded as the date as integer dim early as dim TotFiles, end date set FSO as object as dim FSO = CreateObject ( "Scripting.FileSystemObjec t ") Dim Fldr in kind 'folder Set file as dim f object Fldr = fso.GetFolder (" c: \ vba2sharepoint \ ") username =" Mysharepointusername@domain.com "pw =" mysharepointpassword "Seyrpointuarel = "https://mysite.sharepoint.com/sites/xyz-uat/_layouts/15/start.aspx# / A1docsuat /" set LobjXML = CreateObject ( "Microsoft.XMLHTTP") TotFiles = fldr.Files.Count each f Fldr.files is in sharepointFileName = sharepointUrl & f.Name set Tsin = f.OpenAsTextStream sBody = tsIn.ReadAll tsIn.Close xmlhttp set = CreateObject ( "MSXML2.XMLHTTP.6.0") xmlhttp.Open "PUT", sharepointFileName, false, username, PW xmlhttp.Send sBody i = i + 1 retval = SysCmd (acSysCmdSetStatus, "file" & amp; I I & amp; & copy "of the" amp; TotFiles & amp; "...") set Next f retval = SysCmd (acSysCmdClearStatus) LobjXML = Nothing set FSO = nothing err_Copy: MsgBox Err & amp; "" & Amp; Err.Description If error & lt; & Gt; 0 Then MSBBF er and Android "" & Amp; Err.Description restart Next End then End Sub