1
votes

I have had no luck figuring out how to insert an image (a gif in this case) created in perl with GD directly into an excel workbook, without first saving the image to a file. Is this possible using win32::OLE or one of the perl spreadsheet modules, or is there another trick I'm missing?

What I've tried: searching google, stackoverflow, perlmonks

modules: - spreadsheet::writeexcel - excel::writer::xlsx

win32::OLE - Pictures->Insert - Shapes->AddPicture

All require a file as input; there was ONE (rejected) bug/patch to spreadsheet::writeexcel to allow inline images, but it didn't quite work and I'm disinclined to use non-baseline modules... any ideas?

1

1 Answers

1
votes

Neither Spreadsheet::WriteExcel or Excel::Write::XLSX support adding images from anything other than a file.

I would suggest creating the images as temporary files, inserting them into a worksheet with Excel::Writer::XLSX (which has better image handling) and then removing the temporary files.