I have an Excel VBA macro that I run daily which opens excel files from an internal filepath and pastes the data into my main file. This macro will look to pull multiple different reports. However, if one report does not exist, I get a popup message that states that the file could not be opened (sometimes files are posted late or are incorrectly named). This popup can hold up the entire macro run (ie. if the first file causes an issue, the other files will not be pulled in). Ideally, I want this message not to popup or have a way to automatically click "OK" and then head to an error handling sheet. I've tried turning EnableEvents off and DisplayAlerts off, but have not had any luck as I still get this popup if the file does not exist or is misspelled. Simplified code below where the file will show the popup on "Set oWB = oExcel.Workbooks.Open("http://redactedfilepath.csv")"
Sub TestFileConnection
Dim oExcel As Excel.Application
Dim oWB As Workbook
Set oExcel = New Excel.Application
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.DisplayAlerts = False
Set oWB = oExcel.Workbooks.Open("http://redactedfilepath.csv")
oWB.Sheets("Sheet1").UsedRange.Copy
ThisWorkbook.Sheets("MainFileSheet1").Cells(1, 1).PasteSpecial xlPasteValues
oWB.Application.CutCopyMode = False
oWB.Close False
Set oWB = Nothing
Application.ScreenUpdating = True
Application.EnableEvents = True
Application.DisplayAlerts = True
End Sub