|How to insert an image into spreadsheet from my resources|
| 7:29 am on May 14, 2012 (gmt 0)|
I'm trying to create an add-in for excel with VSTO in VB.net, I imported an image(Logo1) in the resources folder of the project, now I would like to insert in the spreadsheet (mysheet).The image is into the installation package like example the images of the ribbons.
mysheett.Cells(10, 10) = My.Resources.ResourceManager.GetObject("Logo1")
mysheett.OLEObjects.Add(ClassType:="Forms.Image.1", Link:=False, _
DisplayAsIcon:=False, Left:=471.75, Top:=31.5, Width:=293.25, Height _
.Image1.Object.Picture = My.Resources.ResourceManager.GetObject("Logo1")
| 1:52 pm on May 14, 2012 (gmt 0)|
I found one link which walks though inserting an picture in a specific cell, and the related code. The only downside I see is the api assumes the file will be saved in the filesystem, and not sent as a stream object link you are attempting to do.
Inserting Pictures in Excel [exceltip.com]
| 3:10 pm on May 14, 2012 (gmt 0)|
Thanks, but the path must be my folder resources project.
Nobody knows how to do.
[edited by: Ocean10000 at 4:53 pm (utc) on May 14, 2012]
[edit reason] Removed Link [/edit]
| 4:52 pm on May 14, 2012 (gmt 0)|
The tricky way to do it is save the resource file to the local users temp folder, then do the insert from that file location, and delete it when you are done. So the master copy will always be in your install binary. But copies will be saved to the drive long enough to be read by the api call.
| 5:10 pm on May 14, 2012 (gmt 0)|
Complex solution, sorry for the link
I must understand how to use images from the resources folder