A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
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.