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


I need to import GIF images as buttons in my workbook. I then want to
control their behaviour in my procedures. To identify these button
objects I recorded a micro and saw that they are identified as some
Picture No eg. Shapes("Picture15"), shapes("Picture 23"). I have no
clue how this picture numbering ( indexing of shapes ) is handled by
VBA. One button is Picture17 and other is Picture23. On the face of
this it looks very random but I am sure there is some method. Like
when we use commandbuttons each button has a name and we can address
that by the name. How do I identify GIF used as buttons? I must know
the name or some identifier if I want to control the behaviour of the
GIF buttons. Pl help.


--
avveerkar
------------------------------------------------------------------------
avveerkar's Profile: http://www.excelforum.com/member.php...o&userid=30338
View this thread: http://www.excelforum.com/showthread...hreadid=503254

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Indexing of Shapes

You can control the pictures when you insert them:

Option Explicit
Sub testme()

Dim myPict As Picture
Dim myRng As Range

With ActiveSheet
Set myRng = .Range("b3:c4")
Set myPict = .Pictures.Insert("c:\my documents\my pictures\badday.jpg")

End With
With myPict
.Top = myRng.Top
.Left = myRng.Left
.Width = myRng.Width
.Height = myRng.Height
.Name = "Pict_" & .TopLeftCell.Address(0, 0)
.OnAction = "'" & ThisWorkbook.Name & "'!testme03"
End With

End Sub
Sub testme03()
dim myPict as picture
MsgBox "you clicked: " & Application.Caller
set mypict = activesheet.pictures(application.caller)
msgbox mypict.name
End Sub

avveerkar wrote:

I need to import GIF images as buttons in my workbook. I then want to
control their behaviour in my procedures. To identify these button
objects I recorded a micro and saw that they are identified as some
Picture No eg. Shapes("Picture15"), shapes("Picture 23"). I have no
clue how this picture numbering ( indexing of shapes ) is handled by
VBA. One button is Picture17 and other is Picture23. On the face of
this it looks very random but I am sure there is some method. Like
when we use commandbuttons each button has a name and we can address
that by the name. How do I identify GIF used as buttons? I must know
the name or some identifier if I want to control the behaviour of the
GIF buttons. Pl help.

--
avveerkar
------------------------------------------------------------------------
avveerkar's Profile: http://www.excelforum.com/member.php...o&userid=30338
View this thread: http://www.excelforum.com/showthread...hreadid=503254


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Indexing of Shapes


Dear Dave Peterson,

Thank you for response. It answers my question very well.


A V Veerkar


--
avveerkar
------------------------------------------------------------------------
avveerkar's Profile: http://www.excelforum.com/member.php...o&userid=30338
View this thread: http://www.excelforum.com/showthread...hreadid=503254

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
excel document with shapes on it but the shapes do not print [email protected] Excel Worksheet Functions 2 October 22nd 09 06:17 PM
Naming Auto Shapes and Creating new Shapes AL2000 Excel Discussion (Misc queries) 3 September 10th 07 04:12 AM
When drawing shapes in excel the shapes keep disappearing Tape Excel Discussion (Misc queries) 1 October 6th 06 04:23 PM
How can i get more 3D shapes for Auto shapes in excel? Ajey Excel Discussion (Misc queries) 0 March 3rd 05 09:53 AM
How can i get more 3D shapes for Auto shapes in excel? Ajey Excel Discussion (Misc queries) 0 March 3rd 05 09:53 AM


All times are GMT +1. The time now is 07:51 AM.

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"