VBA: Answer YES to Contents of Clipboard

A

ajocius

I'm copying large amount of data from one spreadsheet to another. Then
I close the Workbook.

wb1.Close SaveChanges = False

I then get a dialog box asking me if I want to save the data on the
clipboard or not. I want to choose automatically (via VBA) to not save
the contents on the clipboard.

Sorry I'm just a novice at VBA......but getting better.

Tony
 
N

Nigel

Place the following around your code .....

Application.DisplayAlerts = False

'your code

Application.DisplayAlerts = True
 
O

okaizawa

Hi,

if you want to save (as the subject of your post)
try

Application.DisplayAlerts = False
wb1.Close SaveChanges = False
Application.DisplayAlerts = True

if you don't want to save,

Application.CutCopyMode = False
wb1.Close SaveChanges = False
 
A

ajocius

Thank you to the two fellows who answered my question. You guys are
awesome. Thank you for the quick reply also.

Tony
 

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