Hello.
I have images within an excel file, that I need to manually extract. I have written a program which functions very well for our users with Excel 2007, but will not work with Excel 2003.
Process: User Opens Excel File, Copies Relevant Image to Clipboard User Opens C# Application, Clicks Button Which Gathers Image from Clipboard, and then gathers additional information from the user.
The application code is pretty simple. On button click, the following code is called:
if (Clipboard.GetImage() != null)
{
pictureBox1.Width = Clipboard.GetImage().Width;
pictureBox1.Height = Clipboard.GetImage().Height;
pictureBox1.Image = Clipboard.GetImage();
//...more misc. code...
}
This works flawlessly with Excel 2007, but does not function with Excel 2003.
I have attempted the following debug code, all which fails:
Clipboard.ContainsImage() >> returns false Clipboard.GetDataObject().GetDataPresent(DataFormats.Bitmap) >> false
One thought would be that the Excel 2003 "Office Clipboard" may be interfering? MS PAINT has no issue pasting the image however.
Help?