Excel / VBA / Picture - WorkSheet.Pictures and Picture class reference documentation - access to Picture pixel data RRS feed

  • Question

  • I am seeking for a way to get access to an image pixel data, assuming the image is laid on a Worksheet of a Workbook.

    My goal is to serialize the image data to insert it into a SQL Server table as a varbinary piece of data.

    I have been looking for the reference documentation on the Method/Property Pictures for class Worksheet.

    The following code works perfectly well 

        Dim wks As Worksheet

        Set wks = Application.ActiveSheet
        With wks
        Dim cp As Pictures
        Dim p As Picture
        Set cp = wks.Pictures

    The Application.ActiveSheet does not document the returned class of the object but obviously this is a Worksheet.

    I'am wondering if pixel data can be accessed from the Picture object instance?

    Checking in Worksheet documentation I could find any method/property Pictures.

    I also tried to find information about Picture an item of Pictures. I could'nt find anything either.


    Thursday, May 4, 2017 8:18 AM

All replies

  • There are no methods or properties to get to pixel data.  Whenever I need detailed image data I use Imagemajick (free).  It has a .COM interface.

    • Edited by mogulman52 Friday, May 5, 2017 1:49 PM
    Friday, May 5, 2017 1:48 PM
  • I do know image magick and happened to use it in shell scripts. Can you briefly explain how you combine an excel workbook VBA code and image magick .COM interface or point me to some examples.

    Also I assume that to deploy the VBA application  I will have to deploy image magick which is a pain.


    Friday, May 5, 2017 5:51 PM
  • I've used this website for examples.  Some commands I had to call as command lines in VBA.  I use Inno Setup to distribute my programs and have not had a problem distributing Imagemajick.

    I installed the 32-bit version of Imagemajick.  Not sure if the 64-bit supports it since .com is 32-bit.

    • Edited by mogulman52 Saturday, May 6, 2017 5:37 PM
    Friday, May 5, 2017 11:19 PM