Hi guys,
I'm trying to modify some script that I found on the forum. As it is written it will go out to Sharepoint grab a specific file and save it to a specific path on my hard drive. I am trying to modify it to use a couple of values from the worksheet "MACRO" so that the rest of my team can use the workbook and save the SharePoint file to their hard drive without having to modify the vba.
Here is the original script:
What I want to do is make the file name in both strURL and strSavePath be populated from the value in cell K3 in worksheet "MACRO". Also, I want the MYLOGINID section of strSavePath to be populated from the value in cell L2 of worksheet "MACRO".
As always, your help is greatly appreciated.
Jason
I'm trying to modify some script that I found on the forum. As it is written it will go out to Sharepoint grab a specific file and save it to a specific path on my hard drive. I am trying to modify it to use a couple of values from the worksheet "MACRO" so that the rest of my team can use the workbook and save the SharePoint file to their hard drive without having to modify the vba.
Here is the original script:
Code:
Option Explicit
Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" ( _
ByVal pCaller As Long, ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long
Sub S_SharepointExport()
Dim i As Integer
Const strUrl As String = "https://sites.xxxxxxxx.com/network1/servicedesk/NCC/Shared Documents/Notification Quality Control/01 Quality Notification Review/09_2017 Quality Review - September.xlsx"
Dim strSavePath As String
Dim returnValue As Long
strSavePath = "C:\Users\MYLOGINID\Documents\NCC MACRO\NCC Quality Control\09_2017 Quality Review - September.xlsx"
returnValue = URLDownloadToFile(0, strUrl, strSavePath, 0, 0)
End Sub
What I want to do is make the file name in both strURL and strSavePath be populated from the value in cell K3 in worksheet "MACRO". Also, I want the MYLOGINID section of strSavePath to be populated from the value in cell L2 of worksheet "MACRO".
As always, your help is greatly appreciated.
Jason