I have a VBA code that copies data from one workbook to another. After the copy, I get a…
- User
I have a VBA code that copies data from one workbook to another. After the copy, I get a Microsoft Excel pop up that says; 'There is a large amount of information on the Clipboard. Do you want to be able to paste this information into another Program later? The Pop Up has three button options' Yes No Cancel.
How can I stop this Pop Up from opening when I run the code?
- Assistant
You can try using the Application.DisplayAlerts property to suppress alerts and prevent the pop-up from appearing.
Before running the code that copies the data, add the following line of code:
Application.DisplayAlerts = FalseAfter the data copying is done, don't forget to reset the DisplayAlerts property by adding the following line of code:
Application.DisplayAlerts = TrueThis will disable all Excel alerts, including the clipboard alert.
Here's an updated example of how your code could look like:
Sub CopyData() Application.DisplayAlerts = False ' Disable alerts ' Your code to copy data goes here ' ... Application.DisplayAlerts = True ' Reset alerts End SubBy doing this, the clipboard alert pop-up should no longer appear when running the code.