Extracting bitmap from Excel using Win32::OLE

A

aminnis

Hello all,

Does anyone know how to extract a bitmap from a cell using win32::OLE
and save it to a file? Any help is appreciated.

Alan
 
B

Brian Helterline

aminnis said:
Hello all,

Does anyone know how to extract a bitmap from a cell using win32::OLE
and save it to a file? Any help is appreciated.

Alan

Bitmaps are not in cells, they are on the "Shapes" layer within Excel.
my $bitmap = $excel->ActiveSheet->Shapes(1);
or if you want to limit the search to the selection,
my $bitmap = $excel->ActiveSheet->Selection->Shapes(1);

Then you have to
$bitmap->Copy;

to place it on the clipboard, and

use Win32::Clipboard

to retrieve it and write it to file (using binmode)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top