Macro stops with "Large Amount of Data" Message

D

dhstein

I have macro that copies some data from a workbook and then tries to close
it. I want it to run without stopping, but I get the message that there is a
large amount of data in the clipboard - and I need to click "OK". Is there a
way to suppress that message so the macro will complete? Thanks.
 
P

Pete_UK

You might like to add this to your macro before closing the workbook:

Application.DisplayAlerts = False

This will suppress the error message. Then turn it back on again with
this:

Application.DisplayAlerts = True

Hope this helps.

Pete
 
F

FSt1

hi
add this to the begining of your code...
Application.DisplayAlerts = false

this will turn off all of excel's built in error messages.

but...".big word"....be sure to turn them back on at the end of your code...
very unwise not to..........
Application.DisplayAlerts = TRUE

regards
FSt1
 
D

dhstein

Thanks for the information - it worked great

FSt1 said:
hi
add this to the begining of your code...
Application.DisplayAlerts = false

this will turn off all of excel's built in error messages.

but...".big word"....be sure to turn them back on at the end of your code...
very unwise not to..........
Application.DisplayAlerts = TRUE

regards
FSt1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top