Martin_H
Board Regular
- Joined
- Aug 26, 2020
- Messages
- 190
- Office Version
- 365
- Platform
- Windows
Hi,
I used this macro (see below) to open a folder on the server and it worked perfectly.
Now I am trying to apply same macro to open a folder at SharePoint.
I have changed the address path but I am getting error at this line:
Any help would be appreciated.
TY!
I used this macro (see below) to open a folder on the server and it worked perfectly.
VBA Code:
Public Sub GO_TO_ARCHIVE(ByRef control As Office.IRibbonControl)
'Checks if the archive file exists at the given address
Dim sFolderPath As String
sFolderPath = "ADDRESS PATH"
If Right(sFolderPath, 1) <> "\" Then
sFolderPath = sFolderPath & "\"
End If
If Dir(sFolderPath, vbDirectory) <> vbNullString Then
'==================================================
'Opens archive folder
With Application
.ScreenUpdating = False
Dim strFolder As String
strFolder = "ADDRESS PATH"
ActiveWorkbook.FollowHyperlink Address:=strFolder, NewWindow:=True
.ScreenUpdating = True
End With
Else
MsgBox "The archive was not found at the original address.", vbExclamation
End If
End Sub
Now I am trying to apply same macro to open a folder at SharePoint.
I have changed the address path but I am getting error at this line:
VBA Code:
If Dir(sFolderPath, vbDirectory) <> vbNullString Then
Any help would be appreciated.
TY!