Hello Friends,
I am using this code which download a file & pull some data from it.
The problem is that sometime it takes the file to download but the code jumps to the next part and give this error
Can't we tell the macro to wait until the file is downloaded and then jumps to the workbook open part ??
Regards,
Humayun
I am using this code which download a file & pull some data from it.
VBA Code:
Sub update_database()
Workbooks("REPORTS.xlsm").Worksheets("INDEX").Range("A2").Hyperlinks(1).Follow
Workbooks.Open Filename:=Environ$("USERPROFILE") & "\Downloads\DATA ENTRY.xlsm"
Workbooks("DATA ENTRY.xlsm").Worksheets("VALIDATION").Cells.Copy
Workbooks("REPORTS.xlsm").Worksheets("R VALIDATION").Range("A1").PasteSpecial Paste:=xlPasteValues
Workbooks("DATA ENTRY.xlsm").Close savechanges:=False
Kill (Environ$("USERPROFILE") & "\Downloads\DATA ENTRY.xlsm")
Workbooks("REPORTS.xlsm").Save
End Sub
The problem is that sometime it takes the file to download but the code jumps to the next part and give this error
Can't we tell the macro to wait until the file is downloaded and then jumps to the workbook open part ??
Regards,
Humayun