Insert image into Excel from My.Resources.Images

Hi group,

Anyone have suggestions on how to add an image into Excel from My.Resources

Excel's Shapes.AddPicture requires a string filename.

Dave



Answer this question

Insert image into Excel from My.Resources.Images

  • JDehart

    Thanks for getting back,

    I can't use win controls because they do not work if the Excel worksheet is not zoomed to 100%. The picturebox idea works just fine except there is not way to stop the 'Windows Forms controls have been disabled because the document has been scaled...' if the picturebox is clicked. All I wanted was a static image inserted into Excel.

    I have decided to stay with Excels shapes object. I can save the resource.image to disk, add the shape to Excel and then delete the saved resource.image. Complex but it is the only working solution.

    Thks,

    Rgs,

    Dave


  • dcoe

    If you are using VSTO2005, you can insert a Windows Forms PictureBox into the spreadsheet by using the this.Controls.AddPictureBox method. You can then specify the image for it from the resources.

  • Insert image into Excel from My.Resources.Images