ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Download from FTP (https://www.excelbanter.com/excel-programming/363716-download-ftp.html)

THE_RAMONES

Download from FTP
 
I have macro that combines multiple workbooks from multiple vendors. I
receive this data through an ftp sites, then I save onto my local server. I
was wondering if I could update the code below to download from the ftp
automatically. Please let me know thanks

Ramon



Application.EnableEvents = False
Application.ScreenUpdating = False
Path =
"R:\Reports\PDP-Reporting\CUSTOMER_SERVICE\DAILY\Scorecard\DATA_FE ED\CURRENT_STREAM_WellCare_PDP\OLD FILES\New Folder" ''Change as needed
FileName = Dir(Path & "\*.csv", vbNormal)
Do Until FileName = ""
Set Wkb = Workbooks.Open(FileName:=Path & "\" & FileName)
For Each WS In Wkb.Worksheets
If Left(WS.Name, 20) = "WellcarePDP_Interval" Then
WS.Copy After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Cou nt)
End If
Next WS
Wkb.Close False
FileName = Dir()
Loop
Application.EnableEvents = True
Application.ScreenUpdating = True

Die_Another_Day

Download from FTP
 
Check out this page from the geniuses at "Daily Does of Excel". There
is alot of good info here that might help you.

http://www.dailydoseofexcel.com/arch...9/ftp-via-vba/

HTH

Die_Another_Day


THE_RAMONES wrote:
I have macro that combines multiple workbooks from multiple vendors. I
receive this data through an ftp sites, then I save onto my local server. I
was wondering if I could update the code below to download from the ftp
automatically. Please let me know thanks

Ramon



Application.EnableEvents = False
Application.ScreenUpdating = False
Path =
"R:\Reports\PDP-Reporting\CUSTOMER_SERVICE\DAILY\Scorecard\DATA_FE ED\CURRENT_STREAM_WellCare_PDP\OLD FILES\New Folder" ''Change as needed
FileName = Dir(Path & "\*.csv", vbNormal)
Do Until FileName = ""
Set Wkb = Workbooks.Open(FileName:=Path & "\" & FileName)
For Each WS In Wkb.Worksheets
If Left(WS.Name, 20) = "WellcarePDP_Interval" Then
WS.Copy After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Cou nt)
End If
Next WS
Wkb.Close False
FileName = Dir()
Loop
Application.EnableEvents = True
Application.ScreenUpdating = True



Die_Another_Day

Download from FTP
 
Check out this page from the geniuses at "Daily Dose of Excel". There
is alot of good info here that might help you.

http://www.dailydoseofexcel.com/arch...9/ftp-via-vba/


HTH


Die_Another_Day

THE_RAMONES wrote:
I have macro that combines multiple workbooks from multiple vendors. I
receive this data through an ftp sites, then I save onto my local server. I
was wondering if I could update the code below to download from the ftp
automatically. Please let me know thanks

Ramon



Application.EnableEvents = False
Application.ScreenUpdating = False
Path =
"R:\Reports\PDP-Reporting\CUSTOMER_SERVICE\DAILY\Scorecard\DATA_FE ED\CURRENT_STREAM_WellCare_PDP\OLD FILES\New Folder" ''Change as needed
FileName = Dir(Path & "\*.csv", vbNormal)
Do Until FileName = ""
Set Wkb = Workbooks.Open(FileName:=Path & "\" & FileName)
For Each WS In Wkb.Worksheets
If Left(WS.Name, 20) = "WellcarePDP_Interval" Then
WS.Copy After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Cou nt)
End If
Next WS
Wkb.Close False
FileName = Dir()
Loop
Application.EnableEvents = True
Application.ScreenUpdating = True




All times are GMT +1. The time now is 03:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com