none
Error when exporting to sharepoint from excel RRS feed

  • Question

  • I have an excel macro that we have used for years to save a worksheet in excel to sharepoint. We are now moving to sharepoint online. I have updated my URL to the new site and verified it is correct. But when I attempt to run the process I get this:

    Run Time error '1004'

    Method 'Saveas' of object '_Workbook' failed.

    Here is my code:

           ActiveWorkbook.SaveAs Filename:= _
            "//test.sharepoint.com/sites/Portal/Finance/FinRpt.xlsx", _
            FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
            ActiveWorkbook.Save
            ActiveWindow.Close

     
    Tuesday, March 31, 2020 8:41 PM

All replies

  • Hi J-Bal,

    In the SharePoint Online, you cannot run macro in the excel online. You only can run macro in the local office application.

    References about saving a worksheet in excel to SharePoint Online through excel macro.

    VBA Macro to Save to SharePoint with dynamic file name

    VBA Save Workbook to SharePoint

    This forum is for users discussing issue about SharePoint. But the issue is more related to the excel development.

    If you need further help about excel development, you could post in below thread. The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.

    Thanks for your understanding.

    https://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev

    Best regards,

    Emily Du


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.


    Wednesday, April 1, 2020 7:23 AM