squarezw
squarezw

Reputation: 59

how to save picture in excel with ruby

I have pictures in excel, how to export pictures with ruby

i want to extract the images and save them as image files

Upvotes: 0

Views: 805

Answers (1)

Mark Thomas
Mark Thomas

Reputation: 37517

I understand the question. There is an image (quite possibly an OLE object) in an excel workbook, and you want to save it as an individual image file. The only way I know of to do that is to control Excel itself using the win32ole gem, here's a start (untested, as I run linux):

require 'win32ole'
xl = WIN32OLE.new("Excel.Application")
wb = xl.Workbooks.Open('c:\file.xls')
wb.SaveAs('c:\file.html', 44)
xl.Quit

Then I would pull out the images from the resulting image directory.

Upvotes: 2

Related Questions