I am looking to select some data from an excel file which has a welcoming box. I am trying to get the data using a excel macro. I am struggling to figure out how to click on the pop-up box so that i can proceed with copying the data. The sendkeys function does not seem to be working.
Sub BAI()
Dim objEx As Object
Dim objExFile As Object
Set objEx = CreateObject("Excel.Application")
objEx.Visible = True
Set objExFile = objEx.Workbooks.Open("FileName")
Application.SendKeys ("ESC")
objExFile.Sheets("12Week").Select
Application.EnableEvents = False
objExFile.Save
Set objExFile = Nothing
Set objEx = Nothing
End Sub