PDA

View Full Version : [SOLVED] Getting rid of a popup on closing a workbook



ukdane
03-19-2009, 11:26 AM
So I have some code which closes a workbook, from which I've just copied some data....


Windows(aWB).Close False

However as soon as the code does this, a message box pops up, kindly informing the user that they "... have placed a large amount of data on the clipboard...."

How do I stop this warning appearing (and set the default option to no, so that the data is dropped from the clipboard?

Cheers

mdmackillop
03-19-2009, 11:41 AM
Application.CutCopyMode = False should empty the clipboard

ukdane
03-19-2009, 12:04 PM
I've already got that, and it isn't working:

Range("A1:J" & oldRowCount).Select
Application.CutCopyMode = False
Selection.Copy
Windows("Report.xls").Activate
Sheets("Totals").Select
Range("A1").Select
ActiveSheet.Paste
ActiveSheet.Columns("A:J").AutoFit
' close the data workbook
Windows(aWB).Close False

Edit:
got it, by moving the code


Range("A1:J" & oldRowCount).Select
Selection.Copy
Windows("Report.xls").Activate
Sheets("Totals").Select
Range("A1").Select
ActiveSheet.Paste
ActiveSheet.Columns("A:J").AutoFit
Application.CutCopyMode = False
' close the data workbook
Windows(aWB).Close False

georgiboy
03-19-2009, 12:10 PM
Application.CutCopyMode = False should be after the paste.