473,378 Members | 1,236 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Using VB.Net or C#, utilizing the clipboard object, how to copy an MS Excel graphic from the clipboard to an image control and obtain its source reference

TC
Hello,

Here is what I'm trying to do:

-- Make sure both MS Excel and MS Word are running
-- Create an Excel chart
-- Save the Excel file
-- Copy the Excel chart onto the clipboard using Ctrl + C
-- Go to Word and look under Edit > Paste Special
-- Note there is a source reference and an option to paste the chart as a
metafile, etc.
-- I would like to take this same information and make it available in a C#
or VB.Net app

For example, create a simple Windows application with a userform, an image
control, a label and a single command button.

Let's say that after the Excel chart is on the clipboard, one clicks the
Windows application command button and Voila!, the imate control now
contains a copy of the Excel chart and the label contains the reference
information.

I can make this work utilizing older technologies (i.e. WIN API to access
the clipboard, etc.).

Currently, when I try to set the image control in C#, I get a "cannot
implicitly convert ..." blah blah error. Don't even know where to begin to
obtain the source reference.

Either I do not understand the currently available clipboard functionality
under .Net or this is still only possible via the WIN API.

Any assistance would be appreciated.

Best Regards,

Todd

Nov 16 '05 #1
2 1663
Hi TC,

Keep in mind that it is not important for dotNet how it is set on the
clipboard the only thing that is important what object is on the clipboard.

Here some links that should answer all your questions.

http://msdn.microsoft.com/library/de...ardSupport.asp

http://msdn.microsoft.com/library/de...mpdragdrop.asp

I hope this helps a little bit?

Cor
Nov 16 '05 #2
TC
Hey Cor & Other Folks,

OK, let me clarify a bit here.

Using the WIN32 API, there is a clipboard format called "OwnerLink".
Similarly to the .Net clipboard, one would register this format, check for
it on the clipboard and then retrieve using several API calls.

There are also clipboard formats called "Link Descriptor" and "Object
Descriptor" under WIN32.

I guess it fair to say that, under .Net, there are currently no methods or
properties available to extract a source reference when a user places an
Office object / graphic on the clipboard.

If there is a workaround, by all means, please share.

Best Regards,

Todd

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:eB****************@TK2MSFTNGP09.phx.gbl...
Hi TC,

Keep in mind that it is not important for dotNet how it is set on the
clipboard the only thing that is important what object is on the clipboard.
Here some links that should answer all your questions.

http://msdn.microsoft.com/library/de...ardSupport.asp
http://msdn.microsoft.com/library/de...mpdragdrop.asp
I hope this helps a little bit?

Cor

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Stan | last post by:
In the old days of VB6, an Excel chart image could be pasted into a picture box with Clipboard using the following commands. xlApp.ActiveChart.ChartArea.Copy Picture1.Picture =...
5
by: TC | last post by:
Hello, Here is what I'm trying to do: -- Make sure both MS Excel and MS Word are running -- Create an Excel chart -- Save the Excel file -- Copy the Excel chart onto the clipboard using Ctrl...
1
by: barma16 | last post by:
I've hit a bit of a brick wall here, and could use some advice. I have an Access application whose output is a four-tab Excel spreadsheet where three of the four tabs are the result of database...
7
by: TC | last post by:
Hello, I am familiar with obtaining source file reference material from the system clipboard using the old Win32 API. For example, copy an Excel chart onto the clipboard and goto Word. Under,...
14
by: pmud | last post by:
Hi, I need to use an Excel Sheet in ASP.NET application so that the users can enter (copy, paste ) large number of rows in this Excel Sheet. Also, Whatever the USER ENETRS needs to go to the...
1
by: andrew | last post by:
I have a MSchart object (COM Component) which I wish to insert as an image into a picture box so that I can print it out. 'I call the chart controls's EditCopy to pass data to the clipboard. ...
4
by: Lisa | last post by:
Hi - I'm able to open excel workbooks and word documents, but I can't seem to copy excel charts, named ranges, etc. to a word document. Anyone know of good reference material in this area? What...
1
by: ray well | last post by:
hi, i need to give the user the ability to extract a rectangular area of their choice from a graphic displayed in a picture box to the clipboard, so they can use it elsewhere. say the graphic...
53
by: Hexman | last post by:
Hello All, I'd like your comments on the code below. The sub does exactly what I want it to do but I don't feel that it is solid as all. It seems like I'm using some VB6 code, .Net2003 code,...
8
by: Bruce_Stough | last post by:
I am currently using Control.DoDragDrop to drop a text string into Excel. I use the following code DataObject dd = new DataObject();...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.