PC Review


Reply
Thread Tools Rate Thread

Clear Clipboard after Copy

 
 
Connie
Guest
Posts: n/a
 
      8th Nov 2006
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

 
Reply With Quote
 
 
 
 
Chad
Guest
Posts: n/a
 
      8th Nov 2006

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


 
Reply With Quote
 
Connie
Guest
Posts: n/a
 
      8th Nov 2006
Chad: There was no message in your post.
Thanks!

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


 
Reply With Quote
 
Connie
Guest
Posts: n/a
 
      8th Nov 2006
Chad: There was no message in your post.
Thanks!

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


 
Reply With Quote
 
Alan
Guest
Posts: n/a
 
      8th Nov 2006
Connie,

Use
Application.CutCopyMode = False
after you paste

Alan

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


 
Reply With Quote
 
marcus
Guest
Posts: n/a
 
      9th Nov 2006
Hi Alan

I would solve the problem by putting the following code near the top of
your macro;

Application.DisplayAlerts = False

regards

Marcus


Alan wrote:
> Connie,
>
> Use
> Application.CutCopyMode = False
> after you paste
>
> Alan
>
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clear Clipboard after Copy Connie Microsoft Excel Misc 2 8th Nov 2006 07:20 AM
Clipboard gets empty by itself, cleared clipboard, copy paste doesn't work, outlook clears clipboard, problems with clipboard - possible solution Jens Hoerburger Microsoft Outlook 0 24th Aug 2006 02:44 PM
I am asked to clear clipboard,yet there is no data to clear-help! =?Utf-8?B?UEogTycgTGVhcnk=?= Microsoft Excel Crashes 1 15th Apr 2006 12:30 PM
How do I clear the copy clipboard using VBA? =?Utf-8?B?UmljaGs=?= Microsoft Access VBA Modules 2 8th Dec 2004 08:48 AM
cannot clear clipboard when clipboard appears empty =?Utf-8?B?U2hhbmk=?= Microsoft Excel Misc 1 4th Nov 2004 02:58 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:29 PM.