jordanburch
Active Member
- Joined
- Jun 10, 2016
- Messages
- 443
- Office Version
- 2016
Hi All,
I have the below
Sub OpenFileByPartialName()
Dim partialName As String
Dim file As String
' Enter the partial name of the file you want to open
partialName = "smb"
' Loop through all files in the directory
file = Dir("https://ghtd.sharepoint.com/sites/BankingOperations/BANKFDEPT/ImageCentre/Exported-Extracts\" & partialName & "*")
' Check if the file exists
If file <> "" Then
' Open the file
Workbooks.Open "C:\Your\File\Path\" & file
Else
MsgBox "File not found."
End If
End Sub
For whatever reason I cannot get it to open the file name with SMB in the partial name. Can anyone help?
I have the below
Sub OpenFileByPartialName()
Dim partialName As String
Dim file As String
' Enter the partial name of the file you want to open
partialName = "smb"
' Loop through all files in the directory
file = Dir("https://ghtd.sharepoint.com/sites/BankingOperations/BANKFDEPT/ImageCentre/Exported-Extracts\" & partialName & "*")
' Check if the file exists
If file <> "" Then
' Open the file
Workbooks.Open "C:\Your\File\Path\" & file
Else
MsgBox "File not found."
End If
End Sub
For whatever reason I cannot get it to open the file name with SMB in the partial name. Can anyone help?