none
Ok, so I am trying to upload an excel document to sharepoint 2010, but i keep getting this really odd error: RRS feed

  • Question

  • the error is:

    Run-time error '5':

    Invalid procedure call or argument.

    I have no idea why I am getting this error, maybe someone here can help:

    SharepointAddress = "https://ssharepointsite/sites/anotherSite/AnotherSite/SitePages/Home.aspx?RootFolder=%2Fsites%2Ffiu%5Fmain%2FAMLOperations%2FShared%20Documents%2FReporting%20Program%2FStatus%20Reports%20Process%20Control%20Tracking%2F1%2E%20Daily%20Reports%20Reviewed/DailyReportFor27-05-2016.xlsm" & "\"
     ' Where you will enter the file path, ex: Excel file
    LocalAddress = "\\phx-nas05-e3\Groups57\FIU-PHX\FIU Inventory Report\C Scheduled Reports\P PCD Status Reports\Daily\DailyReportFor27-05-2016.xlsm"
    Set objNet = CreateObject("WScript.Network")
    Set FS = CreateObject("Scripting.FileSystemObject")
    If FS.FileExists(LocalAddress) Then
    
    'Here is where I am getting the error:
    FS.CopyFile LocalAddress, SharepointAddress
    End If
    Set objNet = Nothing
    Set FS = Nothing

    Anything would be great.

    Best regards, Mike

    Friday, May 27, 2016 5:19 PM

Answers

All replies

  • Error 5 is Access Is Denied.

    To troubleshoot this I'd simplify your overly complicated paths and try to copy from C:\Temp to a write-enabled folder residing in the root on your SharePoint:

    Copy C:\Temp\test.txt \\mycompany\sharepoint.com\testfolder


    Best regards, George

    Sunday, May 29, 2016 11:23 AM
  • Hi dzitam,

    did you try to access both the path manually and check it whether they are correct or not?

    try to provide absolute file path and then try to run the code.

    let us know it worked for you or not so that we can try to help you further.

    Regards

    Deepak


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, May 30, 2016 3:37 AM
    Moderator