Share via

How to download a csv file which shows third party links from the document library?

Hannah W 20 Reputation points
2025-07-16T01:53:09.9266667+00:00

Our document library in SharePoint is a bit messy at the moment and I am tasked with tidying it up. A lot of our documents are added to SharePoint as links to a third-party website which holds our company policies to help us be compliant with the law and regulations.

I really need to know which links from the third-party website are on SharePoint and which are not. I also need to find duplicates. To do this I was hoping to download the links from SharePoint Library in excel or CSV file, then use VLOOKUP to compare links with a download from the third-party website.

I have downloaded the SharePoint Library to CSV and anything that shows as a link has a Name that ends in .url, E.G "About Us.url". I used VBA in excel to extract the link in a different column, so it shows this:

Name URL
About Us.url https://[our organisation].sharepoint.com/Organisation Documents/About Us.url

As you can see the URL that has been extracted is a SharePoint link, which when opened in a browser redirects to the third-party website. I need the third-party URL to appear in Excel for this comparison to work. Such as:

Name URL
About Us.url https://[third-party-website].com/Aboutus

No one in my team is an IT expert, we are nurses and administrators, so we need a way to do this without things like PowerShell. I am not proficient with VBA but if I find someone else online has created a VBA then I know how to implement it and that's the maximum expanse of knowledge on the team.

Does SharePoint have something built in to be able to see where the links lead to on third-party websites instead of showing SharePoint links?

Hope this makes sense.

Microsoft 365 and Office | SharePoint | For business | Windows

3 answers

Sort by: Most helpful
  1. Teddie-D 16,210 Reputation points Microsoft External Staff Moderator
    2025-07-17T09:14:48.9866667+00:00

    Hi @Hannah W
    I apologize for any earlier confusion.
    I used this VBA to extract .url files, but please note that you must first download the .url files to your local machine. Although this approach takes time, it seems to be the most effective workaround at this time.

    Sub ExtractURLsFromURLFiles() 
        Dim folderPath As String 
        Dim fileName As String 
        Dim filePath As String 
        Dim fileContent As String 
        Dim lineText As String 
        Dim url As String 
        Dim rowNum As Long 
        Dim fileNum As Integer 
      
        ' Set your folder path here 
        folderPath = "C:\yourpath"  ' <-- Change this to your actual folder path 
        ' Ensure folder path ends with a backslash 
        If Right(folderPath, 1) <> "\" Then 
            folderPath = folderPath & "\" 
        End If 
      
        ' Get the first .url file in the folder 
        fileName = Dir(folderPath & "*.url") 
        rowNum = 2 
      
        ' Set headers in Excel 
        Cells(1, 1).Value = "File Name" 
        Cells(1, 2).Value = "Extracted URL" 
      
        ' Loop through all .url files 
        Do While fileName <> "" 
            filePath = folderPath & fileName 
            fileNum = FreeFile 
      
            ' Open the .url file and read its content 
            Open filePath For Input As #fileNum 
            Do Until EOF(fileNum) 
                Line Input #fileNum, lineText 
                If InStr(lineText, "URL=") > 0 Then 
                    url = Mid(lineText, InStr(lineText, "URL=") + 4) 
                    Exit Do 
                End If 
            Loop 
            Close #fileNum 
      
            ' Write results to Excel 
            Cells(rowNum, 1).Value = fileName 
            Cells(rowNum, 2).Value = url 
            rowNum = rowNum + 1 
            url = "" 
      
            ' Get next file 
            fileName = Dir 
        Loop 
      
        MsgBox "URLs extracted successfully!" 
    End Sub    
    

    I double-checked your issue and found that SharePoint does not currently offer a built-in feature to automatically extract third-party URLs and populate them into a new column. The most practical solution remains to manually add a custom hyperlink column, as previously suggested.
    I hope this helps. 
    If you have any further concerns, please feel free to reach me out. 

    If you think my answer is helpful to you, don't forget to mark it as your answer. Warm thanks.

    Was this answer helpful?


  2. Hannah W 20 Reputation points
    2025-07-16T06:30:44.72+00:00

    Hi Teddy, thanks for replying. I want to clarify some information with you.

    You say "Since PowerShell isn’t an option, the only practical workaround is to manually extract the .url files using VBA like you’ve been doing."

    As stated in my original post, using this shows the Sharepoint URL, not the external third-party URL so this isn't an option?

    Is there a way to find the URLs to the third party and populate a new column instead of more manual work of going into each SharePoint link to find the third-party URL and enter it manually. Thanks

    Was this answer helpful?

    0 comments No comments

  3. Teddie-D 16,210 Reputation points Microsoft External Staff Moderator
    2025-07-16T05:36:23.69+00:00

    Hi @Hannah W  
    Thank you for posting your question in the Microsoft Q&A forum. 
    SharePoint uses a feature called “Link to a Document”, which allows users to upload .url files that point to external resources. However, these .url files are stored as documents in SharePoint and when exported to CSV, they often appear as SharePoint-hosted links like: https://[tenant].sharepoint.com/sites/.../filename.url. This behavior is by design and does not expose the actual third-party destination URL directly. 

    Since PowerShell isn’t an option, the only practical workaround is to manually extract the .url files using VBA like you’ve been doing. It may take some time, but it’s the most effective method under these constraints. 
    To streamline future workflows and avoid this kind of situation again, consider adding a custom hyperlink column to your SharePoint library. You can do this by switching to Grid view, clicking Edit in grid view at the top, and modifying the column settings. This allows you to directly manage links in a way that typical SharePoint views don’t support. 
    In modern SharePoint libraries, Microsoft has replaced the library-specific search box with a unified search bar at the top of the page. This bar searches across the entire site or tenant, not just the current library. As a result, it may not return results scoped to your current view or folder. 

    To improve search accuracy and filter out incorrect results, go to Library Settings > More library settings > Advanced Settings:

    -Set “Allow items to appear in search results” and "Allow non-default views from this list to appear in search results" to Yes. 

    -Reindex the library.
    User's image
    Please note that if your library contains a large volume of content, it may take some time for the changes to take full effect.
    User's image

    I hope this helps. 


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".    

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.