Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
how does one change the image shown in a picture object, without
removing the picture object and adding it again? Best regards, Carlos Pedro |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On a worksheet???
Did you use Insert|Picture to insert the picture or did you insert an image control (from the control toolbox toolbar) and then insert a picture into that. If you used Insert|Picture, I don't think you can change it--just delete and add. If you used the image control, then you could go into design mode, show the properties and change the properties. or in code... Worksheets("Sheet1").OLEObjects("Image1").Object.P icture _ = LoadPicture("C:\My Pictures\01.jpg") You'll need a reference to OLE Automation (under Tools|references in the VBE). === the same kind of thing (loadpicture) in an image control on a userform. Sister Ray wrote: how does one change the image shown in a picture object, without removing the picture object and adding it again? Best regards, Carlos Pedro -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On 17 mar, 16:06, Dave Peterson wrote:
On a worksheet??? Yes, I got the pictures collection from a worksheet and added a picture to it, using the insert method exposed by the pictures object. Did you use Insert|Picture to insert the picture or did you insert an image control (from the control toolbox toolbar) and then insert a picture into that. It was a picture, not an image control. If you used Insert|Picture, I don't think you can change it--just delete and add. However since I'm using the index property of the Picture object "know" which image I'm accessing if I remove an image and add a new one to replace it the indexes will have changed. If you used the image control, then you could go into design mode, show the properties and change the properties. or in code... * Worksheets("Sheet1").OLEObjects("Image1").Object.P icture _ * * * * * * = LoadPicture("C:\My Pictures\01.jpg") Image Control? How is this exposed by the Excel COM? You'll need a reference to OLE Automation (under Tools|references in the VBE). I'm automating excel using C++ and the Excel COM, all the help I've found so far has been the VBA reference, VBA foruns and 3 msdn pages that talk about MFC/C++ Office Automation. Is there a news group dedicated do MFC/C++ Office automation? There must be a reazonable amout of people automating excel this way, and hopefully they will be helpful. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don't speak the COM.
Maybe someone can jump in. Sister Ray wrote: On 17 mar, 16:06, Dave Peterson wrote: On a worksheet??? Yes, I got the pictures collection from a worksheet and added a picture to it, using the insert method exposed by the pictures object. Did you use Insert|Picture to insert the picture or did you insert an image control (from the control toolbox toolbar) and then insert a picture into that. It was a picture, not an image control. If you used Insert|Picture, I don't think you can change it--just delete and add. However since I'm using the index property of the Picture object "know" which image I'm accessing if I remove an image and add a new one to replace it the indexes will have changed. If you used the image control, then you could go into design mode, show the properties and change the properties. or in code... Worksheets("Sheet1").OLEObjects("Image1").Object.P icture _ = LoadPicture("C:\My Pictures\01.jpg") Image Control? How is this exposed by the Excel COM? You'll need a reference to OLE Automation (under Tools|references in the VBE). I'm automating excel using C++ and the Excel COM, all the help I've found so far has been the VBA reference, VBA foruns and 3 msdn pages that talk about MFC/C++ Office Automation. Is there a news group dedicated do MFC/C++ Office automation? There must be a reazonable amout of people automating excel this way, and hopefully they will be helpful. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel Image or Picture from SQL Image Data Type | Excel Programming | |||
Getting Picture Into Image In UserForm | Excel Programming | |||
image & picture | Excel Programming | |||
Charts to Image or Picture? | Charts and Charting in Excel | |||
VBA : A picture from http://.../Image.gif | Excel Programming |