I’m looking for a way to extract cell range from a spreadsheet document as an image file without any user action.
I able generating spreadsheet documents using OpenXML SDK.
I want to define a cell range and use .NET to render these cells as Image.
This function exists in Excel, I think it’s possible to manage it using macro : Export bitmap image from Excel cells
However I don’t know if it exists a way to execute a macro with OpenXML SDK.
Can someone help me ? Thank you.
It’s possible to manage Excel with interrop, about memory issues you just need to read Microsoft documentation about COM and Marshaling components
http://social.msdn.microsoft.com/Forums/fr-FR/visualcsharpfr/thread/e7c5109f-2beb-4669-b73c-50d28f29f6cf then read the clipboard and cast metadata bitmap into Bitmap class.
http://support.microsoft.com/default.aspx?scid=kb;en-us;317109 to avoid memory issues, you must implement NAR method as purposed.
I recommand you to put your logic in a STA thread if you use it in a Web app or a web service.