Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Change Picture

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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 91
Default Change Picture

On May 13, 12:59*am, B Lynn B
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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Change Picture

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
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.


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Change Picture

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" wrote in message
...
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
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.


.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Change Picture

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" wrote in message
...
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
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change picture How to change Picture in excel software Excel Worksheet Functions 1 February 6th 09 08:58 AM
Change Background Picture Montu Excel Worksheet Functions 0 December 8th 08 12:30 PM
Change CommandButton Picture TheVisionThing Excel Programming 0 December 14th 05 05:24 PM
Auto Userform Picture Change Shake Excel Programming 2 November 6th 05 02:57 AM
how to change background picture Soe[_2_] Excel Programming 1 October 23rd 04 04:41 PM


All times are GMT +1. The time now is 03:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"