JoeyGaspard
Board Regular
- Joined
- Jul 22, 2019
- Messages
- 147
Hi All, I am using the code below, and it works perfectly, but it is popping up the "Clear Clipboard" message box each time and it has to be clicked for the Routine to complete, what could I use to answer this automatically and finish the routine out?
Sub Get_Data_From_File()
Dim FileToOpen As Variant
Dim OpenBook As Workbook
Application.ScreenUpdating = False
FileToOpen = Application.GetOpenFilename(Title:="Browse for your file and Import range", FileFilter:="Excel Files (*.xls*),*xls*")
If FileToOpen <> False Then
Set OpenBook = Application.Workbooks.Open(FileToOpen)
'Edit Range Below
OpenBook.Sheets(1).Range("A1:I100").Copy
ThisWorkbook.Worksheets("PayDataw5").Range("A1").PasteSpecial xlPasteValues
OpenBook.Close False
End If
Application.ScreenUpdating = True
End Sub
Here is the message box I dont want the users to see:
Thanks in advance for any help!
Sub Get_Data_From_File()
Dim FileToOpen As Variant
Dim OpenBook As Workbook
Application.ScreenUpdating = False
FileToOpen = Application.GetOpenFilename(Title:="Browse for your file and Import range", FileFilter:="Excel Files (*.xls*),*xls*")
If FileToOpen <> False Then
Set OpenBook = Application.Workbooks.Open(FileToOpen)
'Edit Range Below
OpenBook.Sheets(1).Range("A1:I100").Copy
ThisWorkbook.Worksheets("PayDataw5").Range("A1").PasteSpecial xlPasteValues
OpenBook.Close False
End If
Application.ScreenUpdating = True
End Sub
Here is the message box I dont want the users to see:
Thanks in advance for any help!