How to avoid the "There is a large amount of data in the clipboard... " dialog box

K

Keith B

I have a Word VBA Subroutine the opens an excel spreadsheet, copies a range
into the clipboard, closes the excel application, and then pastes the
information from the clipboard into the word document. I am getting the
"There is a large amount of data in the clipboard... " dialog box. How can I
disable this feature from within my Word VBA subroutine?

Thanks,

Keith
 
J

Jezebel

Copy something small to the clipboard before exiting. (eg, select the first
character of your document and copy that).

Better is not to use the clipboard at all. There are easier ways to transfer
data from Excel to Word (eg, read the Excel Range into a variable).
 
P

Peter_A_M (NL)

.... but if you do want to use this method:
With Application.DisplayAlerts = wdAlertsNone at least you suppress the
message.
(In that case the default option is chosen.)
Don't forget to restore to Application.DisplayAlerts = wdAlertsAll within
your code!

Peter
 

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