samualgrowler
New Member
- Joined
- Jun 9, 2015
- Messages
- 1
Hello all,
Background: I have several different invoices placed in five different folders , each week those invoices will be updated by our finance department, and saved under the same name.
The issue :The issue is all the files always saved under different extensions, for example,
file1_060920158686, next week the file will be updated to file1_061620158466, and those files are saved on a sharepoint site.
Questions :I found a code on this forum that allow me to copy the files to a shared folder, is there a way that will allow me to search the file by the last modified date, then copy the file by its last modified date, and place it in the shared folder?
How can I implement a code that will continuously loop until all the files from different network folders on that sharepoint site are all copied to my hard drive?
Here is the code I found on this forum.
Thanks in advance
Background: I have several different invoices placed in five different folders , each week those invoices will be updated by our finance department, and saved under the same name.
The issue :The issue is all the files always saved under different extensions, for example,
file1_060920158686, next week the file will be updated to file1_061620158466, and those files are saved on a sharepoint site.
Questions :I found a code on this forum that allow me to copy the files to a shared folder, is there a way that will allow me to search the file by the last modified date, then copy the file by its last modified date, and place it in the shared folder?
How can I implement a code that will continuously loop until all the files from different network folders on that sharepoint site are all copied to my hard drive?
Here is the code I found on this forum.
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 DownloadFileFromWeb()
Dim i As Integer
Const strUrl As String = "http://teams/Dept/Shared Documents/Reports/Pivot_Source_Data/filename.csv"
Dim strSavePath As String
Dim returnValue As Long
strSavePath = "C:\Reports\Pivot_Source_Data\xxxxxxxx.CSV"
returnValue = URLDownloadToFile(0, strUrl, strSavePath, 0, 0)
End Sub
Thanks in advance
Last edited by a moderator: