Help!

VBA picture from excel sheet

 
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> General Discussions RSS
Next:  can not find data1.msi  
Author Message
PHason
External


Since: Jan 25, 2007
Posts: 3



PostPosted: Thu Jan 25, 2007 8:33 pm    Post subject: VBA picture from excel sheet
Archived from groups: microsoft>public>powerpoint (more info?)

I'm working on automating a slideshow where it pulls the data in from
an excel worksheet. One of the sheets has pictures that are added to
the sheet and are named. Is it possible for me to reference those
pictures, which will always be the same name from the excel sheet and
put them on a slide through vba? I've been playing with placeholders
and then changing the background with a picture from a directory, and
that works well.


Using something like:
ActivePresentation.Slides("NewHires").Shapes("img1").Fill.UserPicture
"c:\pic.jpg"


How would I do the same thing for a picture in an excel sheet? Is it
possible, or should I be using a different method for pictures in
powerpoint? Any suggestions would be great.
Back to top
Shyam Pillai
External


Since: Mar 22, 2006
Posts: 198



PostPosted: Fri Jan 26, 2007 12:09 am    Post subject: Re: VBA picture from excel sheet [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

UserPicture requires the file on disk. You cannot reference it from an excel
file.


--
Regards,
Shyam Pillai

Animation Carbon
http://www.AnimationCarbon.com


"PHason" wrote in message

> I'm working on automating a slideshow where it pulls the data in from
> an excel worksheet. One of the sheets has pictures that are added to
> the sheet and are named. Is it possible for me to reference those
> pictures, which will always be the same name from the excel sheet and
> put them on a slide through vba? I've been playing with placeholders
> and then changing the background with a picture from a directory, and
> that works well.
>
>
> Using something like:
> ActivePresentation.Slides("NewHires").Shapes("img1").Fill.UserPicture
> "c:\pic.jpg"
>
>
> How would I do the same thing for a picture in an excel sheet? Is it
> possible, or should I be using a different method for pictures in
> powerpoint? Any suggestions would be great.
>
Back to top
PHason
External


Since: Jan 25, 2007
Posts: 3



PostPosted: Fri Jan 26, 2007 2:27 am    Post subject: Re: VBA picture from excel sheet [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Jan 25, 10:44 pm, Steve Rindsberg wrote:
> In article , PHason
> wrote:
>
> Or instead of using a picture-filled shape, why not copy/paste the picture into
> PPT as a new shape?
>
> -----------------------------------------
> Steve Rindsberg, PPT MVP
> PPT FAQ: www.pptfaq.com
> PPTools: www.pptools.com
> ================================================

Thanks, Steve and Shyam for the responses. I'm not very adept at vba so
I wanted to stay away from having to remove the picture and replace it
each time the slideshow looped through because it seemed like it would
be too much work for placement and other considerations. What I ended
up doing is having the picture in excel get inserted into a blank
chart, then exporting the picture to a file as a picture in the same
directory, then having the code in powerpoint use those picture files
to do the .Fill UserPicture process. I'm not sure if it's the most
efficient way, but it seems to do the job well enough.
Back to top
Steve Rindsberg
External


Since: Apr 02, 2004
Posts: 8555



PostPosted: Fri Jan 26, 2007 4:44 am    Post subject: Re: VBA picture from excel sheet [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article , PHason
wrote:
> I'm working on automating a slideshow where it pulls the data in from
> an excel worksheet. One of the sheets has pictures that are added to
> the sheet and are named. Is it possible for me to reference those
> pictures, which will always be the same name from the excel sheet and
> put them on a slide through vba? I've been playing with placeholders
> and then changing the background with a picture from a directory, and
> that works well.
>
> Using something like:
> ActivePresentation.Slides("NewHires").Shapes("img1").Fill.UserPicture
> "c:\pic.jpg"
>
> How would I do the same thing for a picture in an excel sheet? Is it
> possible, or should I be using a different method for pictures in
> powerpoint? Any suggestions would be great.

Can you store the path to the image file in the Excel sheet along with (or
instead of) the picture?

Or instead of using a picture-filled shape, why not copy/paste the picture into
PPT as a new shape?

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Back to top
ValentinMorrisonRamos
External


Since: Jan 25, 2007
Posts: 6



PostPosted: Fri Jan 26, 2007 12:23 pm    Post subject: Re: VBA picture from excel sheet [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

if the desired effect was to get the images out of the excel file,
would not saving the excel out to a web page have created a folder with
all the images in it?

On Jan 26, 12:27 am, "PHason" wrote:
> On Jan 25, 10:44 pm, Steve Rindsberg wrote:
>
> > In article , PHason
> > wrote:
>
> > Or instead of using a picture-filled shape, why not copy/paste the picture into
> > PPT as a new shape?
>
> > -----------------------------------------
> > Steve Rindsberg, PPT MVP
> > PPT FAQ: www.pptfaq.com
> > PPTools: www.pptools.com
> > ================================================Thanks, Steve and Shyam for the responses. I'm not very adept at vba so
> I wanted to stay away from having to remove the picture and replace it
> each time the slideshow looped through because it seemed like it would
> be too much work for placement and other considerations. What I ended
> up doing is having the picture in excel get inserted into a blank
> chart, then exporting the picture to a file as a picture in the same
> directory, then having the code in powerpoint use those picture files
> to do the .Fill UserPicture process. I'm not sure if it's the most
> efficient way, but it seems to do the job well enough.
Back to top
PHason
External


Since: Jan 25, 2007
Posts: 3



PostPosted: Fri Jan 26, 2007 6:40 pm    Post subject: Re: VBA picture from excel sheet [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Jan 26, 9:23 am, wrote:
> if the desired effect was to get the images out of the excel file,
> would not saving the excel out to a web page have created a folder with
> all the images in it?
>

I need a user form where a person can open the worksheet, push a button
under one of the pictures, change that picture, then save the
worksheet. Then powerpoint will show whatever picture was chosen by the
user. If i automated the save as part to a webpage, then the worksheet
would actually change to the new webpage file and would save as that
and the pictures it creates are named differently each time, therefore
making it more difficult to reference them in the slideshow. I wanted
it to be as automated as possible.
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> General Discussions All times are: Eastern Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum