Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default xlClipboard Clear Contents

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default xlClipboard Clear Contents

Tom,

That code should be placed directly after the paste operation.
Actually, better to place it after each paste operation.
If it's not working, post the section of your code where you're getting
the alert.

While the pop-up help shows you xlCut and xlCopy, using False should
clear the clipboard.

John

Tom wrote:

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


.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default xlClipboard Clear Contents

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


.

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Tom is offline
external usenet poster
 
Posts: 3
Default xlClipboard Clear Contents

John-

I am still having the same problem with the clipboard. I
do not know if it could be related to the fact that the
code is using two spreadsheets. Below is the code which is
located in file w2

Set X = ActiveSheet.Range("A2")
Do While Not IsEmpty(X)
Set Y = X.Offset(1, 0)
Set Z = X.Offset(0, 8)
Range(X, Z).Copy
Workbooks.Open Filename:= _
"F:w1.xls"
Windows("w1.xls").Activate
ActiveWorkbook.Sheets("Links").Select
Range("B1").Select
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Application.Run "'w1.xls'!Macro3"
ActiveWorkbook.Sheets("Principal").Select
Range("F6").Select
ActiveCell.End(xlDown).Select
Selection.Name = "BBB123"
Range("F6", "BBB123").Copy
Windows("w2.xls").Activate
ActiveWorkbook.Sheets("PBal").Select
Range("E1").Activate
ActiveCell.End(xlDown).Activate
Set Q = ActiveCell
Q.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Workbooks("w1.xls").Close SaveChanges:=False
Set X = Y
Loop
Application.Run "'w2.xls'!PlaceStars"
End Sub
-----Original Message-----
Tom,

That code should be placed directly after the paste

operation.
Actually, better to place it after each paste operation.
If it's not working, post the section of your code where

you're getting
the alert.

While the pop-up help shows you xlCut and xlCopy, using

False should
clear the clipboard.

John

Tom wrote:

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

.


.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default xlClipboard Clear Contents

Tom,

I don't see
Application.CutCopyMode = False
after your paste line.

steve

"Tom" wrote in message
...
John-

I am still having the same problem with the clipboard. I
do not know if it could be related to the fact that the
code is using two spreadsheets. Below is the code which is
located in file w2

Set X = ActiveSheet.Range("A2")
Do While Not IsEmpty(X)
Set Y = X.Offset(1, 0)
Set Z = X.Offset(0, 8)
Range(X, Z).Copy
Workbooks.Open Filename:= _
"F:w1.xls"
Windows("w1.xls").Activate
ActiveWorkbook.Sheets("Links").Select
Range("B1").Select
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Application.Run "'w1.xls'!Macro3"
ActiveWorkbook.Sheets("Principal").Select
Range("F6").Select
ActiveCell.End(xlDown).Select
Selection.Name = "BBB123"
Range("F6", "BBB123").Copy
Windows("w2.xls").Activate
ActiveWorkbook.Sheets("PBal").Select
Range("E1").Activate
ActiveCell.End(xlDown).Activate
Set Q = ActiveCell
Q.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Workbooks("w1.xls").Close SaveChanges:=False
Set X = Y
Loop
Application.Run "'w2.xls'!PlaceStars"
End Sub
-----Original Message-----
Tom,

That code should be placed directly after the paste

operation.
Actually, better to place it after each paste operation.
If it's not working, post the section of your code where

you're getting
the alert.

While the pop-up help shows you xlCut and xlCopy, using

False should
clear the clipboard.

John

Tom wrote:

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

.


.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default xlClipboard Clear Contents

Tom,

You're doing a lot of "Selects" which I'm sure are unnecessary.
Haven't tested your code but it's possible that the copy followed
by opening the workbook may be what's causing your problem.
If no one else chimes in with some abbreviated code (without all
those selects), I'll take a look at it later when I get home.

John


Tom wrote:

Steve,

I removed the Application.CutCopyMode = False statement
which I had placed after each paste in the code so that I
could show the original code.

Thanks
-----Original Message-----
Tom,

I don't see
Application.CutCopyMode = False
after your paste line.

steve

"Tom" wrote in message
...
John-

I am still having the same problem with the clipboard. I
do not know if it could be related to the fact that the
code is using two spreadsheets. Below is the code which

is
located in file w2

Set X = ActiveSheet.Range("A2")
Do While Not IsEmpty(X)
Set Y = X.Offset(1, 0)
Set Z = X.Offset(0, 8)
Range(X, Z).Copy
Workbooks.Open Filename:= _
"F:w1.xls"
Windows("w1.xls").Activate
ActiveWorkbook.Sheets("Links").Select
Range("B1").Select
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Application.Run "'w1.xls'!Macro3"
ActiveWorkbook.Sheets("Principal").Select
Range("F6").Select
ActiveCell.End(xlDown).Select
Selection.Name = "BBB123"
Range("F6", "BBB123").Copy
Windows("w2.xls").Activate
ActiveWorkbook.Sheets("PBal").Select
Range("E1").Activate
ActiveCell.End(xlDown).Activate
Set Q = ActiveCell
Q.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Workbooks("w1.xls").Close SaveChanges:=False
Set X = Y
Loop
Application.Run "'w2.xls'!PlaceStars"
End Sub
-----Original Message-----
Tom,

That code should be placed directly after the paste
operation.
Actually, better to place it after each paste

operation.
If it's not working, post the section of your code

where
you're getting
the alert.

While the pop-up help shows you xlCut and xlCopy, using
False should
clear the clipboard.

John

Tom wrote:

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

.


.



.


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default xlClipboard Clear Contents

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
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
Clear Contents gibbylinks Setting up and Configuration of Excel 5 October 12th 09 05:04 PM
Macro to clear contents and put an X bevchapman Excel Discussion (Misc queries) 3 March 17th 09 07:03 PM
Clear Contents Secret Squirrel Excel Discussion (Misc queries) 1 February 3rd 09 12:37 AM
Code to clear contents jk Excel Worksheet Functions 3 September 4th 06 06:25 PM
Clear clipboard contents Cordobes Excel Discussion (Misc queries) 4 November 22nd 05 02:41 AM


All times are GMT +1. The time now is 07:45 PM.

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"