Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I'm trying to move the location of two command buttons by using a With statement but am getting the error below. My code is also below. Any help is appreciated! Error: Run-time error 438: Object doesn't support this property or method. Code: With .Shapes("submemid") .ShapeRange.Top = 18 .ShapeRange.Left = 153.75 End With -- Robert |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You may want to qualify .shape
How about something like With ActiveSheet.Shapes("submemid") I've worked with shapes in PowerPoint, but not Excel, so let me know if it works as expected. HTH, Barb Reinhardt "robs3131" wrote: Hi, I'm trying to move the location of two command buttons by using a With statement but am getting the error below. My code is also below. Any help is appreciated! Error: Run-time error 438: Object doesn't support this property or method. Code: With .Shapes("submemid") .ShapeRange.Top = 18 .ShapeRange.Left = 153.75 End With -- Robert |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Barb,
I tried that - got the same error. Below is the code I tried: Sheets("Member ID Report Input").Activate With ActiveSheet.Shapes("submemid") .ShapeRange.Top = 8 .ShapeRange.Left = 23.75 End With With ActiveSheet.Shapes.Shapes("CommandButton1") .ShapeRange.Top = 8 .ShapeRange.Left = 173.75 End With -- Robert "Barb Reinhardt" wrote: You may want to qualify .shape How about something like With ActiveSheet.Shapes("submemid") I've worked with shapes in PowerPoint, but not Excel, so let me know if it works as expected. HTH, Barb Reinhardt "robs3131" wrote: Hi, I'm trying to move the location of two command buttons by using a With statement but am getting the error below. My code is also below. Any help is appreciated! Error: Run-time error 438: Object doesn't support this property or method. Code: With .Shapes("submemid") .ShapeRange.Top = 18 .ShapeRange.Left = 153.75 End With -- Robert |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I wonder if the shape names aren't really what you think they are. Try this:
Sub FindShape() Dim myShape As Object For Each myShape In ActiveSheet.Shapes myShape.Select Debug.Print myShape.Name, myShape.top, myshape.left Next myShape End Sub Step through this so that you know what shape is being selected and what the name is. That might help you figure out what's happening. HTH, Barb Reinhardt "robs3131" wrote: Hi Barb, I tried that - got the same error. Below is the code I tried: Sheets("Member ID Report Input").Activate With ActiveSheet.Shapes("submemid") .ShapeRange.Top = 8 .ShapeRange.Left = 23.75 End With With ActiveSheet.Shapes.Shapes("CommandButton1") .ShapeRange.Top = 8 .ShapeRange.Left = 173.75 End With -- Robert "Barb Reinhardt" wrote: You may want to qualify .shape How about something like With ActiveSheet.Shapes("submemid") I've worked with shapes in PowerPoint, but not Excel, so let me know if it works as expected. HTH, Barb Reinhardt "robs3131" wrote: Hi, I'm trying to move the location of two command buttons by using a With statement but am getting the error below. My code is also below. Any help is appreciated! Error: Run-time error 438: Object doesn't support this property or method. Code: With .Shapes("submemid") .ShapeRange.Top = 18 .ShapeRange.Left = 153.75 End With -- Robert |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
With ActiveSheet.Shapes("submemid")
.Top = 18 .Left = 153.75 End With -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "robs3131" wrote in message ... Hi, I'm trying to move the location of two command buttons by using a With statement but am getting the error below. My code is also below. Any help is appreciated! Error: Run-time error 438: Object doesn't support this property or method. Code: With .Shapes("submemid") .ShapeRange.Top = 18 .ShapeRange.Left = 153.75 End With -- Robert |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Bob and Barb for your help!
-- Robert "Bob Phillips" wrote: With ActiveSheet.Shapes("submemid") .Top = 18 .Left = 153.75 End With -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "robs3131" wrote in message ... Hi, I'm trying to move the location of two command buttons by using a With statement but am getting the error below. My code is also below. Any help is appreciated! Error: Run-time error 438: Object doesn't support this property or method. Code: With .Shapes("submemid") .ShapeRange.Top = 18 .ShapeRange.Left = 153.75 End With -- Robert |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
command buttons disappear when I move worksheet 2007 | Excel Discussion (Misc queries) | |||
have toggle buttons but everytime print preview buttons move | Excel Discussion (Misc queries) | |||
How to make command buttons move among worksheets? | Excel Programming | |||
Use of Command Buttons to Move Through Worksheets | Excel Programming | |||
Control Buttons vs. Command Buttons | Excel Programming |