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:= _
            "//", _
            FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False

    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.

    Best regards,

    Emily Du

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

    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