homepage Welcome to WebmasterWorld Guest from 54.227.215.139
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
How to insert an image into spreadsheet from my resources
MBerner



 
Msg#: 4453119 posted 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.
I tried

I tried

mysheett.Cells(10, 10) = My.Resources.ResourceManager.GetObject("Logo1")

also

mysheett.OLEObjects.Add(ClassType:="Forms.Image.1", Link:=False, _
DisplayAsIcon:=False, Left:=471.75, Top:=31.5, Width:=293.25, Height _
:=125.25).Select()
.Image1.Object.Picture = My.Resources.ResourceManager.GetObject("Logo1")

don't works

 

Ocean10000

WebmasterWorld Administrator 10+ Year Member



 
Msg#: 4453119 posted 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]

MBerner



 
Msg#: 4453119 posted 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]

Ocean10000

WebmasterWorld Administrator 10+ Year Member



 
Msg#: 4453119 posted 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.

MBerner



 
Msg#: 4453119 posted 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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved