ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA: Answer YES to Contents of Clipboard (https://www.excelbanter.com/excel-programming/335315-vba-answer-yes-contents-clipboard.html)

ajocius

VBA: Answer YES to Contents of Clipboard
 

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


--
ajocius
------------------------------------------------------------------------
ajocius's Profile: http://www.excelforum.com/member.php...o&userid=17695
View this thread: http://www.excelforum.com/showthread...hreadid=389549


Nigel

Answer YES to Contents of Clipboard
 
Place the following around your code .....

Application.DisplayAlerts = False

'your code

Application.DisplayAlerts = True

--
Cheers
Nigel



"ajocius" wrote in
message ...

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


--
ajocius
------------------------------------------------------------------------
ajocius's Profile:

http://www.excelforum.com/member.php...o&userid=17695
View this thread: http://www.excelforum.com/showthread...hreadid=389549




okaizawa

VBA: Answer YES to Contents of Clipboard
 
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

--
HTH,

okaizawa

ajocius wrote:
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



ajocius[_2_]

VBA: Answer YES to Contents of Clipboard
 

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

Tony


--
ajocius
------------------------------------------------------------------------
ajocius's Profile: http://www.excelforum.com/member.php...o&userid=17695
View this thread: http://www.excelforum.com/showthread...hreadid=389549



All times are GMT +1. The time now is 04:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com