Large Amount of Info on Clipboard
Using Excel 2003 I recorded a macro that opens a second file, copies a large
amount of data from it that gets pasted into the original file, then closes this second file. I've used this code as a base to do what I actually want. My problem is when the code closes the second file with: ActiveWindow.Close Savechanges:=False At that point Excel comes to a halt with a message window telling me that there's a large amount of data on the clipboard, and do I want to save it? How do I get VBA to tell it 'no' without this message window coming up? Thanks. Bill |
Large Amount of Info on Clipboard
Try:
application.cutcopymode = false activewindow.close savechanges:=false (I'd use a variable for the workbook. I don't trust the windows collection.) application.cutcopymode = false activeworkbook.close savechanges:=false 'or wkbk.close savechanges:=false Bill Martin wrote: Using Excel 2003 I recorded a macro that opens a second file, copies a large amount of data from it that gets pasted into the original file, then closes this second file. I've used this code as a base to do what I actually want. My problem is when the code closes the second file with: ActiveWindow.Close Savechanges:=False At that point Excel comes to a halt with a message window telling me that there's a large amount of data on the clipboard, and do I want to save it? How do I get VBA to tell it 'no' without this message window coming up? Thanks. Bill -- Dave Peterson |
Large Amount of Info on Clipboard
Thanks Dave. That works for me.
Bill ------------------- On 2/23/2010 10:48 AM, Dave Peterson wrote: Try: application.cutcopymode = false activewindow.close savechanges:=false (I'd use a variable for the workbook. I don't trust the windows collection.) application.cutcopymode = false activeworkbook.close savechanges:=false 'or wkbk.close savechanges:=false Bill Martin wrote: Using Excel 2003 I recorded a macro that opens a second file, copies a large amount of data from it that gets pasted into the original file, then closes this second file. I've used this code as a base to do what I actually want. My problem is when the code closes the second file with: ActiveWindow.Close Savechanges:=False At that point Excel comes to a halt with a message window telling me that there's a large amount of data on the clipboard, and do I want to save it? How do I get VBA to tell it 'no' without this message window coming up? Thanks. Bill |
All times are GMT +1. The time now is 05:24 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com