#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Clipboard


i have a macro that opens numerous excel spreadsheets in an array an
pastes data into sheets in a master document. after each paste th
source spreadsheet is closed, then the loop begins again by opening th
next spreadsheet in the array.

the problem i have is the message stating that "there is a large amoun
of data still on the clipboard etc.." when each source spreadsheet i
closed. This requires me to manually select "NO" at the end of ever
loop, to inform Excel that i do not need this data to be stored fo
future use (as i have already pasted it).

is there a way of disabling this, or coding something in the macro t
automatically select "NO" when prompted by the clipboard message.

any ideas welcomed

--
presuming e
-----------------------------------------------------------------------
presuming ed's Profile: http://www.excelforum.com/member.php...fo&userid=3152
View this thread: http://www.excelforum.com/showthread.php?threadid=51219

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Clipboard

Hi,
take this:

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal
lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As
Long
Private Declare Function EmptyClipboard Lib "user32" () As Long
Private Declare Function CloseClipboard Lib "user32" () As Long

Public Sub CleanClipBoard()
OpenClipboard FindWindow("xlMain", vbNullString)
EmptyClipboard
CloseClipboard
end sub

Jens



"presuming ed" wrote:


i have a macro that opens numerous excel spreadsheets in an array and
pastes data into sheets in a master document. after each paste the
source spreadsheet is closed, then the loop begins again by opening the
next spreadsheet in the array.

the problem i have is the message stating that "there is a large amount
of data still on the clipboard etc.." when each source spreadsheet is
closed. This requires me to manually select "NO" at the end of every
loop, to inform Excel that i do not need this data to be stored for
future use (as i have already pasted it).

is there a way of disabling this, or coding something in the macro to
automatically select "NO" when prompted by the clipboard message.

any ideas welcomed!


--
presuming ed
------------------------------------------------------------------------
presuming ed's Profile: http://www.excelforum.com/member.php...o&userid=31526
View this thread: http://www.excelforum.com/showthread...hreadid=512190


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Clipboard

Kikde,
why use api's when excel can do it itself?

application.cutcopymode = false will clear the clipboard.

note to OP:

you can avoid leaving data on the clipboard by specifying the
destination as an argument to the copy or cut function like

range("source").cut range("destination")


else after every paste or when routine finishes
or before you close the (copied) workbook use

application.cutcopymode = false



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


kikde wrote :

Hi,
take this:

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA"
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function OpenClipboard Lib "user32" (ByVal hwnd As
Long) As Long
Private Declare Function EmptyClipboard Lib "user32" () As Long
Private Declare Function CloseClipboard Lib "user32" () As Long

Public Sub CleanClipBoard()
OpenClipboard FindWindow("xlMain", vbNullString)
EmptyClipboard
CloseClipboard
end sub

Jens



"presuming ed" wrote:


i have a macro that opens numerous excel spreadsheets in an array
and pastes data into sheets in a master document. after each paste
the source spreadsheet is closed, then the loop begins again by
opening the next spreadsheet in the array.

the problem i have is the message stating that "there is a large
amount of data still on the clipboard etc.." when each source
spreadsheet is closed. This requires me to manually select "NO" at
the end of every loop, to inform Excel that i do not need this data
to be stored for future use (as i have already pasted it).

is there a way of disabling this, or coding something in the macro
to automatically select "NO" when prompted by the clipboard message.

any ideas welcomed!


--
presuming ed
--------------------------------------------------------------------
---- presuming ed's Profile:
http://www.excelforum.com/member.php...o&userid=31526
View this thread:
http://www.excelforum.com/showthread...hreadid=512190


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Where does Ms XL store the clipboard ? or where does MS Windowsstore clipboard ? Subu Setting up and Configuration of Excel 1 May 18th 09 06:56 AM
Where does Ms XL store the clipboard ? or where does MS Windowsstore clipboard ? Subu Setting up and Configuration of Excel 0 May 5th 09 01:20 PM
Clipboard empty but still get waring that clipboard is full Steve Excel Discussion (Misc queries) 0 June 17th 08 09:05 PM
Store clipboard before "vba do cut&paste" then recover stored information to clipboard? Marie J-son[_7_] Excel Programming 0 February 8th 06 05:59 AM
ClearContents or ClearFormats also clears Clipboard. How can I keep the clipboard? [email protected] Excel Programming 5 December 16th 05 02:30 AM


All times are GMT +1. The time now is 06:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"