empty clipboard using macro (vb script)

S

Steve

i have workbook a to m, and x

i wrote a macro using vb to...
open workbook a,
then copy information from workbook a to workbook x,
close workbook a,
then repeat the procedure for all workbooks.

but due to the amount of data that every workbooks has,
the windows dialog box will said something like 'do you
want to empty the clipboard' when it's trying to close the
workbook.

how to i automate this so it will empty the clipboard
before it closes the file.

thx.
 
T

Toby Erkson

After the Paste operation use:
Application.CutCopyMode = False
This is supposed to purge the contents of the clipboard.

Also try this:
Application.DisplayAlerts = False
at the beginning of your code and
Application.DisplayAlerts = True
at the end of your code.
 
F

Frank Kabel

Hi
have a look at
http://tinyurl.com/3yoqc


Try for example the following code:

Public Declare Function OpenClipboard Lib "user32" ( _
ByVal hwnd AsLong) As Long
Public Declare Function CloseClipboard Lib "user32" () As Long
Public Declare Function EmptyClipboard Lib "user32" () As Long

Sub ClearClipboard()
OpenClipboard (0&)
EmptyClipboard
CloseClipboard
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top