Cakz Primz
Board Regular
- Joined
- Dec 4, 2016
- Messages
- 102
- Office Version
- 365
- Platform
- Windows
Dear All,
I need to copy an Excel workbook from SharePoint into my local C drive, is it possible to do it with macro?
I have access and authorized to SharePoint, and I am using MS Office 365. I can copy/download manually from SharePoint.
I can even save my active Excel workbook using VBA to SharePoint, it means that I have no issue in authorization.
And I found this below code from Google, it gave me no error message/debug, but no file is being copied.
Even when I try this code below, no messagebox appear.
Really appreciate if somebody could help me and assist me.
Thank so much in advance.
prima - Indonesia
I need to copy an Excel workbook from SharePoint into my local C drive, is it possible to do it with macro?
I have access and authorized to SharePoint, and I am using MS Office 365. I can copy/download manually from SharePoint.
I can even save my active Excel workbook using VBA to SharePoint, it means that I have no issue in authorization.
And I found this below code from Google, it gave me no error message/debug, but no file is being copied.
VBA Code:
Sub DownloadFromSharepoint()
Dim SharepointAddress As String
Dim LocalAddress As String
Dim FS As Object
SharepointAddress = "https://saipem.sharepoint.com/sites/dashboardtangguhlng/Shared Documents/PAMF/PROJECT_AGREEMENT_MANAGEMENT_FORM & REGISTER_Updated T&C.xlsx"
LocalAddress = "C:\PROJECT_AGREEMENT_MANAGEMENT_FORM & REGISTER_Updated T&C.xlsx"
Set FS = CreateObject("Scripting.FileSystemObject")
If FS.FileExists(SharepointAddress) Then
FS.CopyFile SharepointAddress, LocalAddress
End If
End Sub
Even when I try this code below, no messagebox appear.
VBA Code:
Sub DownloadFromSharepoint()
Dim SharepointAddress As String
Dim LocalAddress As String
Dim FS As Object
SharepointAddress = "https://saipem.sharepoint.com/sites/dashboardtangguhlng/Shared Documents/PAMF/Purchase Order.xlsx"
LocalAddress = "C:\"
Set FS = CreateObject("Scripting.FileSystemObject")
If FS.FileExists(SharepointAddress) Then
MessageBox "File Exist"
End If
End Sub
Really appreciate if somebody could help me and assist me.
Thank so much in advance.
prima - Indonesia