Solved

Excel macro-Clipboard answer

Posted on 2002-07-03
3
1,267 Views
Last Modified: 2011-10-03
How do I write my Excel 2000 macro to automatically answer the following question "YES"?  "There is a large amount of information on the Clipboard.  Do you want to be able to paste this information into another program?" Yes/No/Cancel are choices.
This pops up whenever I try to close one spreadsheet (csv file) after I have copied its entire contents to the clipboard for pasting into another spreadsheet.
0
Comment
Question by:mcqj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 45

Expert Comment

by:aikimark
ID: 7127721
I'm not sure that can be done exactly as you wish.

You can use the DataObject in place of the Clipboard object if your Excel VBA code is doing the movement of data.  If you're doing the copy/paste by hand instead of programmatically, you're out of luck.

You might include code in the worksheet close event that will copy the contents of the clipboard to the dataobject and clear the clipboard.

Be warned: unlike the clipboard object, the Dataobject contents aren't persistent beyond the life of the Excel program.
0
 

Author Comment

by:mcqj
ID: 7127742
Could you please illustrate the movement of all cells of one spreadsheet into another spreadsheet using the DataObject in place of the Clipboard?

The best I've been able to do so far is to use:
Application.DisplayAlerts = False
0
 
LVL 45

Accepted Solution

by:
aikimark earned 100 total points
ID: 7127771
If you need all cells, then you really want to do a worksheet copy operation, don't you?  

The following two examples copy without using the clipboard, since I specify the destination with the copy operation.

Example of copying an entire worksheet:
Worksheets("Sheet1").Copy after := Worksheets("Sheet3")

Example of copying the used range to another worksheet:
Worksheets("Sheet1").UsedRange.Copy destination:=Worksheets("Sheet3").Range("A1")
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question