ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   shape runtime error 438 excel 2007 (https://www.excelbanter.com/excel-programming/379116-shape-runtime-error-438-excel-2007-a.html)

wolmFromAustria

shape runtime error 438 excel 2007
 

I couldn't get the Name of the parent of a shape.
In my codes I often use the parent.name expression to find out
In which sheet a shape is positioned.

e.g.
Sub mytest()

Dim curshape As Shape
With ActiveSheet

Set curshape = .Shapes.AddTextbox(msoTextOrientationHorizontal, 12, 12,
12, 12)
Debug.Print curshape.Parent.Name

End With

End Sub

This works in excel 2000 and 2003 without problems.

Is this a bug of excel 2007 or is there another solution to get such info?

THX


Jim Rech

shape runtime error 438 excel 2007
 
I've had problems too with my code that manipulates shapes. I know that MS
has done a lot of work getting shapes to be more consistent across the
Office 2007 suite and that's created a few problems for us.

I found this code works in Excel 2003 and 2007:

Debug.Print curshape.DrawingObject.Parent.Name

--
Jim
"wolmFromAustria" wrote in message
...

I couldn't get the Name of the parent of a shape.
In my codes I often use the parent.name expression to find out
In which sheet a shape is positioned.

e.g.
Sub mytest()

Dim curshape As Shape
With ActiveSheet

Set curshape = .Shapes.AddTextbox(msoTextOrientationHorizontal, 12, 12,
12, 12)
Debug.Print curshape.Parent.Name

End With

End Sub

This works in excel 2000 and 2003 without problems.

Is this a bug of excel 2007 or is there another solution to get such info?

THX




wolmFromAustria

shape runtime error 438 excel 2007
 
Thanks Jim,

yes that was where I am searching for.

wope


"Jim Rech" wrote:

I've had problems too with my code that manipulates shapes. I know that MS
has done a lot of work getting shapes to be more consistent across the
Office 2007 suite and that's created a few problems for us.

I found this code works in Excel 2003 and 2007:

Debug.Print curshape.DrawingObject.Parent.Name

--
Jim
"wolmFromAustria" wrote in message
...

I couldn't get the Name of the parent of a shape.
In my codes I often use the parent.name expression to find out
In which sheet a shape is positioned.

e.g.
Sub mytest()

Dim curshape As Shape
With ActiveSheet

Set curshape = .Shapes.AddTextbox(msoTextOrientationHorizontal, 12, 12,
12, 12)
Debug.Print curshape.Parent.Name

End With

End Sub

This works in excel 2000 and 2003 without problems.

Is this a bug of excel 2007 or is there another solution to get such info?

THX






All times are GMT +1. The time now is 02:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com