URL path for Folder (Excel VBA)

Anonymous
2022-05-19T04:32:05+00:00

I am trying to get the URL for the Sharepoint folder in order to write a macro to save sheets as pdfs.

  • I have synced the folder

The issue lies is if I copy the path address it produces a local path (i.e C:\Users\USER\COMPANY\FOLDER) which results in if another user uses the workbook the macro doesn't work.

I have multiple office accounts. Does the user account need to tie up to the user per the registered product

Can anybody assist?

Microsoft 365 and Office | Excel | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Anonymous
    2022-05-19T06:23:08+00:00

    Hi RIT150,

    If you are trying to get the location of the Excel workbook that is stored in SharePoint online library, open that workbook in desktop application and then click File>Info>Copy path.

    Image

    Clicking “Copy path” will give you a path in this format: https://Tenant.sharepoint.com/sites/SiteName/Shared%20Documents/FileName.xlsx?web=1

    With this starting point, all you need to do is remove the ?web=1 query string parameter at the end of the URL, and you have the path to the workbook that you need to write a macro.

    You will get this kind of URL after removing ?web=1 that you can use in macro.

    https://Tenant.sharepoint.com/sites/SiteName/Shared%20Documents/FileName.xlsx

    Please check if this works for you. If you need any help let me know. Have a nice day and stay safe😊

    Regards,

    Neha

    25 people found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2022-05-24T06:21:24+00:00

    Thnak you

    1 person found this answer helpful.
    0 comments No comments