Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 144
Default Help using With statement to move command buttons

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Help using With statement to move command buttons

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 144
Default Help using With statement to move command buttons

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Help using With statement to move command buttons

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Help using With statement to move command buttons

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 144
Default Help using With statement to move command buttons

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
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
command buttons disappear when I move worksheet 2007 moulage Excel Discussion (Misc queries) 1 January 25th 10 08:56 PM
have toggle buttons but everytime print preview buttons move TinSandhu Excel Discussion (Misc queries) 1 October 11th 06 02:57 PM
How to make command buttons move among worksheets? Rick Excel Programming 6 July 21st 05 06:06 PM
Use of Command Buttons to Move Through Worksheets golf4 Excel Programming 1 April 11th 04 03:46 PM
Control Buttons vs. Command Buttons Robert Gibson Excel Programming 1 October 13th 03 04:33 PM


All times are GMT +1. The time now is 12:06 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"