ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Clear Clipboard after Copy (https://www.excelbanter.com/excel-discussion-misc-queries/117889-clear-clipboard-after-copy.html)

Connie

Clear Clipboard after Copy
 
I am using the following code to cut and paste data from a csv file
into a sheet within a workbook. The problem is that when I close the
csv file, I get prompted as to whether or not I want to save the
contents of the clipboard as the clipboard contains a large amount of
data. How do I clear the clipboard to avoid this prompt? Any help
would be appreciated. Thanks!

Connie
************************************************** ************************************************** *************

Set wkbk = ActiveWorkbook
Set sh = Worksheets("Employee List")
Set wb = Workbooks.Open(FileName:= _
"C:\Documents and Settings\Connie Maldonado\My
Documents\Mastec\Employee List\hourly employees.csv")
wb.Worksheets(1).Cells.Copy
wkbk.Worksheets("Employee List").Cells.PasteSpecial
Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
wb.Close savechanges:=False


paul

Clear Clipboard after Copy
 
at the end of you cut copy pricedure
Application.CutCopyMode = False
--
paul

remove nospam for email addy!



"Connie" wrote:

I am using the following code to cut and paste data from a csv file
into a sheet within a workbook. The problem is that when I close the
csv file, I get prompted as to whether or not I want to save the
contents of the clipboard as the clipboard contains a large amount of
data. How do I clear the clipboard to avoid this prompt? Any help
would be appreciated. Thanks!

Connie
************************************************** *************************Â************************ **************

Set wkbk = ActiveWorkbook
Set sh = Worksheets("Employee List")
Set wb = Workbooks.Open(FileName:= _
"C:\Documents and Settings\Connie Maldonado\My
Documents\Mastec\Employee List\hourly employees.csv")
wb.Worksheets(1).Cells.Copy
wkbk.Worksheets("Employee List").Cells.PasteSpecial
Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
wb.Close savechanges:=False



Connie

Clear Clipboard after Copy
 
Thanks, Paul. This worked!

Connie

paul wrote:
at the end of you cut copy pricedure
Application.CutCopyMode = False
--
paul

remove nospam for email addy!



"Connie" wrote:

I am using the following code to cut and paste data from a csv file
into a sheet within a workbook. The problem is that when I close the
csv file, I get prompted as to whether or not I want to save the
contents of the clipboard as the clipboard contains a large amount of
data. How do I clear the clipboard to avoid this prompt? Any help
would be appreciated. Thanks!

Connie
************************************************** ************************************************** *************

Set wkbk = ActiveWorkbook
Set sh = Worksheets("Employee List")
Set wb = Workbooks.Open(FileName:= _
"C:\Documents and Settings\Connie Maldonado\My
Documents\Mastec\Employee List\hourly employees.csv")
wb.Worksheets(1).Cells.Copy
wkbk.Worksheets("Employee List").Cells.PasteSpecial
Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
wb.Close savechanges:=False





All times are GMT +1. The time now is 12:44 PM.

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