I have written a macro which open three file (Deutschland, United Kingdom & France) and copy the data from the eighth sheet and paste in the respective sheet.
My colleagues upload the file on the location and it works fine. But sometime one or two of the colleagues are unable to upload the file on time. And macro breaks down as file is not located. Is there any way I can put a condition if the macro doesn't find the file in the folder it skips and go to the next file.
'*Sheets within the workbook*
Dim SDL As Worksheet
Dim SUK As Worksheet
Dim SFR As Worksheet
Set SDL = Sheets("SDL")
Set SUK = Sheets("SUK")
Set SFR = Sheets("SFR")
'*Workbooks to be used for the data*
Dim tmpSDL As Workbook
Dim tmpSUK As Workbook
Dim tmpSFR As Workbook
Application.DisplayAlerts = False
'*Copy the data from the workbook's sheet no.8 and copy in respective sheet*
Set tmpSDL = Workbooks.Open("http://xxx/europs/erp/BC_ERP/FSMC/Budget/FY15/Country/SDL/Category Package (PAL, MP, BP)/TV/SDL - BP template_OB15_TV.xlsx")
tmpSDL.Sheets(8).Range("A1:BO5000").Copy
SDL.Range("A1:BO5000").PasteSpecial
tmpSDL.Close
Set tmpSUK = Workbooks.Open("http://xxx/europs/erp/BC_ERP/FSMC/Budget/FY15/Country/SUK/Category Package (PAL, MP, BP)/TV/SUK - BP template_OB15_TV.xlsx")
tmpSUK.Sheets(8).Range("A1:BO5000").Copy
SUK.Range("A1:BO5000").PasteSpecial
tmpSUK.Close
Set tmpSFR = Workbooks.Open("http://xxx/europs/erp/BC_ERP/FSMC/Budget/FY15/Country/SFR/Category Package (PAL, MP, BP)/TV/SFR - BP template_OB15_TV.xlsx")
tmpSFR.Sheets(8).Range("A1:BO5000").Copy
SFR.Range("A1:BO5000").PasteSpecial
tmpSFR.Close
Application.DisplayAlerts = True
Bookmarks