?
Solved

Excel macro-Clipboard answer

Posted on 2002-07-03
3
Medium Priority
?
1,279 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
  • 2
3 Comments
 
LVL 46

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 46

Accepted Solution

by:
aikimark earned 300 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses
Course of the Month15 days, 18 hours left to enroll

850 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