PC Review


Reply
Thread Tools Rate Thread

Change Picture

 
 
B Lynn B
Guest
Posts: n/a
 
      12th May 2010
After using the 2007 ribbon menus to insert a picture on my sheet, I can
right click the picture and get an option to "change picture". But macro
recorder doesn't capture this, and I've had a hard time finding the answer in
the object model reference. What is the code equivalent of "change picture"?
Please and thanks!
 
Reply With Quote
 
 
 
 
Javed
Guest
Posts: n/a
 
      13th May 2010
On May 13, 12:59*am, B Lynn B <BLy...@discussions.microsoft.com>
wrote:
> After using the 2007 ribbon menus to insert a picture on my sheet, I can
> right click the picture and get an option to "change picture". *But macro
> recorder doesn't capture this, and I've had a hard time finding the answer in
> the object model reference. *What is the code equivalent of "change picture"?
> *Please and thanks!


You can use following:

Worksheets("Sheetname").Pictures.Insert "Filename"

Don't ask me why the pictures object not in Object model of Sheet
object.Ask MS.


 
Reply With Quote
 
B Lynn B
Guest
Posts: n/a
 
      13th May 2010
Thanks Javed. Appreciate the effort to help. The code below adds a new
picture, so there are then two. I already have it solved that way - while
first deleting the one already there. I was hoping to change the image of an
existing picture.

And I agree, as I looked for a way to "speak" to the existing picture
object, I had a hard time believing it simply didn't exist in the object
model.

"Javed" wrote:

> On May 13, 12:59 am, B Lynn B <BLy...@discussions.microsoft.com>
> wrote:
> > After using the 2007 ribbon menus to insert a picture on my sheet, I can
> > right click the picture and get an option to "change picture". But macro
> > recorder doesn't capture this, and I've had a hard time finding the answer in
> > the object model reference. What is the code equivalent of "change picture"?
> > Please and thanks!

>
> You can use following:
>
> Worksheets("Sheetname").Pictures.Insert "Filename"
>
> Don't ask me why the pictures object not in Object model of Sheet
> object.Ask MS.
>
>
> .
>

 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      13th May 2010
> I had a hard time believing it simply didn't exist in the object
> model.


Me too!
As you say the only way appears to insert a new picture. What you could do
is start by extracting all the properties from the original Picture, in
particular it's dimensions, order-position and name. Insert the new picture
then assign all similar properties including its name (after deleting the
original picture of course).

Regards,
Peter T


"B Lynn B" <(E-Mail Removed)> wrote in message
news:1D7B4548-0B2B-4145-B7A9-(E-Mail Removed)...
> Thanks Javed. Appreciate the effort to help. The code below adds a new
> picture, so there are then two. I already have it solved that way - while
> first deleting the one already there. I was hoping to change the image of
> an
> existing picture.
>
> And I agree, as I looked for a way to "speak" to the existing picture
> object, I had a hard time believing it simply didn't exist in the object
> model.
>
> "Javed" wrote:
>
>> On May 13, 12:59 am, B Lynn B <BLy...@discussions.microsoft.com>
>> wrote:
>> > After using the 2007 ribbon menus to insert a picture on my sheet, I
>> > can
>> > right click the picture and get an option to "change picture". But
>> > macro
>> > recorder doesn't capture this, and I've had a hard time finding the
>> > answer in
>> > the object model reference. What is the code equivalent of "change
>> > picture"?
>> > Please and thanks!

>>
>> You can use following:
>>
>> Worksheets("Sheetname").Pictures.Insert "Filename"
>>
>> Don't ask me why the pictures object not in Object model of Sheet
>> object.Ask MS.
>>
>>
>> .
>>



 
Reply With Quote
 
B Lynn B
Guest
Posts: n/a
 
      14th May 2010
Thanks Peter - it's helpful just to have confirmation that I should stop
looking for the answer and chalk it up to application builders' oversight. I
can live with that more easily than fretting over the possibility I've just
failed to find the right solution.

"Peter T" wrote:

> > I had a hard time believing it simply didn't exist in the object
> > model.

>
> Me too!
> As you say the only way appears to insert a new picture. What you could do
> is start by extracting all the properties from the original Picture, in
> particular it's dimensions, order-position and name. Insert the new picture
> then assign all similar properties including its name (after deleting the
> original picture of course).
>
> Regards,
> Peter T
>
>
> "B Lynn B" <(E-Mail Removed)> wrote in message
> news:1D7B4548-0B2B-4145-B7A9-(E-Mail Removed)...
> > Thanks Javed. Appreciate the effort to help. The code below adds a new
> > picture, so there are then two. I already have it solved that way - while
> > first deleting the one already there. I was hoping to change the image of
> > an
> > existing picture.
> >
> > And I agree, as I looked for a way to "speak" to the existing picture
> > object, I had a hard time believing it simply didn't exist in the object
> > model.
> >
> > "Javed" wrote:
> >
> >> On May 13, 12:59 am, B Lynn B <BLy...@discussions.microsoft.com>
> >> wrote:
> >> > After using the 2007 ribbon menus to insert a picture on my sheet, I
> >> > can
> >> > right click the picture and get an option to "change picture". But
> >> > macro
> >> > recorder doesn't capture this, and I've had a hard time finding the
> >> > answer in
> >> > the object model reference. What is the code equivalent of "change
> >> > picture"?
> >> > Please and thanks!
> >>
> >> You can use following:
> >>
> >> Worksheets("Sheetname").Pictures.Insert "Filename"
> >>
> >> Don't ask me why the pictures object not in Object model of Sheet
> >> object.Ask MS.
> >>
> >>
> >> .
> >>

>
>
> .
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change command button picture to text then back to picture =?Utf-8?B?QWRhbSBUaHdhaXRlcw==?= Microsoft Access 2 11th Sep 2007 02:32 PM
Change a rectangular picture to round picture =?Utf-8?B?SnVkaXRo?= Microsoft Powerpoint 1 23rd Jul 2006 08:05 AM
How do I change the default picture editor re: Windows Picture Vie =?Utf-8?B?TUI=?= Windows XP General 3 2nd Jun 2006 12:53 PM
Newebie: How do I change a Picture Box on a Visual C++ / CLR managed form into a picture box array? Charles Microsoft VC .NET 4 20th Mar 2006 02:15 PM
change cell change picture =?Utf-8?B?TWljb3Mz?= Microsoft Excel Misc 0 18th Nov 2004 12:39 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:43 AM.