Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Steve,
When I posted Tom had confirmed that "Application.CutCopyMode = False" did not work and nor did "xlClipboard.Clear". Tom had not yet posted his code. My method is Excel application independant and therefore I would think would circumvent complications arising from his code. Below is a post by Dick Kusleika from June 23rd, 2003. However, the solution offerred in the link he includes didn't work for me when I tried it a while back. Regards, Greg Quote from Dick Kusleika post follows: Subject: Emptying the clipboard From: "Dick Kusleika" Sent: 6/23/2003 12:09:52 PM Pete Application.CutCopyMode = False doesn't really empty the clipboard, it just tells Excel that it's empty so that you can't paste. Jake Marx once suggested that you could copy an empty cell to make the clipboard smaller so you don't get that message. Or you could try this http://www.mvps.org/skp/off00004.htm#2 -- Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. "Pete Provencher" wrote in message ... Using Excel 2000: I'm having problems emptying the clipboard. By all I have read, it can be done by using Application.CutCopyMode = False. I have this in my code right after the paste but by looking at the toolbar clipboard the files are still in the clipboard. Another question I have is when I copy the data and then close the workbook, it asks me if I want to keep the info in the clipboard for use later. Is there a way to bypass this notification and automatically keep it in the clipboard thru code? Here is the code I'm using: Private Sub CommandButton1_Click() Sheets("Population Download").Cells.Clear Sheets("Demographics Download").Cells.Clear ChDir "c:\Documents and settings\pete\desktop\Demographic Downloads" FileToOpenPop = Application.GetOpenFilename("Excel Files (*.xls), *.xls") Workbooks.Open FileToOpenPop Worksheets(1).Range("A1:H70").Copy ActiveWorkbook.Close False Windows("Quick Facts1").Activate ThisWorkbook.Sheets("population download").Range ("A1").PasteSpecial Paste:=xlPasteAll Application.CutCopyMode = False ChDir "c:\Documents and settings\pete\desktop\Demographic Downloads" FileToOpenDem = Application.GetOpenFilename("Excel Files (*.xls), *.xls") Workbooks.Open FileToOpenDem Worksheets(1).Range("A1:H80").Copy ActiveWorkbook.Close False Windows("Quick Facts1").Activate ThisWorkbook.Sheets("demographics download").Range ("A1").PasteSpecial Paste:=xlPasteAll Application.CutCopyMode = False End Sub -----Original Message----- Greg, Nice, but why go to the trouble when Apllication.CutCopyMode = False after each paste should do the trick. steve "Greg Wilson" wrote in message ... The following API functions should do it I would think. 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 Sub Test() OpenClipboard (0&) EmptyClipboard CloseClipboard End Sub Regards, Greg -----Original Message----- John, When I put in Application.CutCopyMode I get two options after the CutCopyMode which are xlcut or xlcopy. I ran the program with Apllication.CutCopyMode = False and the dialog box still came up saying the clipboard if full, do I want to save or not. Any more Suggestions? Thanks, Tom -----Original Message----- Tom, Application.CutCopyMode = False should do the trick John Tom wrote: Hi Guys- I have a vba program that runs through multiple iterations. After some point the clipboard becomes full and the dialog box comes up asking if I want to save contents and I have to hit the no button. I have tried using xlClipboard.Clear but I get an error that says I have an invalid qualifier. Any suggestions on how I can control the xlClipboard and set it so that it clears contents on each loop. Thanks . . . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Clear Contents | Setting up and Configuration of Excel | |||
Macro to clear contents and put an X | Excel Discussion (Misc queries) | |||
Clear Contents | Excel Discussion (Misc queries) | |||
Code to clear contents | Excel Worksheet Functions | |||
Clear clipboard contents | Excel Discussion (Misc queries) |