View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Clear data from clipboard using VBA

Hi
try
...
Application.displayalerts = False
mybook.Close False
Application.displayalerts = True

Note: this does not clear the clipboard, just prevents the message


--
Regards
Frank Kabel
Frankfurt, Germany

tom wrote:
HI everyone,

I am running a loop that gathers information from one workbook to
another. I get a message asking if I want to save the inforamtion on
the clipboard for further use. I don't want to save this information
so how can I stop this from happening?

For x = 0 To 6
m = b - x
bb = Format(m, "yyyymmdd")
Sheets.Add
ActiveSheet.Name = bb
Range("A1").Select
Set mybook = Workbooks.Open("Test - " & bb)

Sheets("Test1").Activate
Columns("b:f").Select
Selection.Copy

Windows(newbook).Activate

Selection.PasteSpecial Paste:=xlValues, operation:=xlNone,
skipblanks:= _
False, Transpose:=False

mybook.Close False

Here is a portion of the loop that is causing the information to be
placed on the clipboard. Is it possible to clear it with the
pastspecial formula?

Thank you for any insight you may have.

Tom