Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a function that gets called from the Worksheet_Change event.
Based on a set of conditions it adds a shape to the worksheet using a function like this: Set newShape = ws.Shapes.AddShape(shapeType, l, t, w, h) where ws is a Worksheet object and shapeType is a msoAutoShapeType variable. In general it works fine. But while doing some testing I came across a strange (to me) error. If I add a number of shapes to the worksheet, then delete one, subsequent calls to this function raise an error. The error is 434 - object required. Here's the weirdness: - The shape gets properly created - Debug.Assert Not(ws is Nothing) checks out fine - Debug.Assert Not(ws.Shapes is Nothing) checks out fine - Debug.Print ws.Shapes.Count spits out the proper shape count before and after the line. So I'm not sure which 'object' it's referring to since they all seem to be there and are visible is the Locals window when debugging. Any ideas? Thanks, Nick Hebb |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Got error in Shapes.AddShape() | Charts and Charting in Excel | |||
Window Error when deleting shapes | Excel Programming | |||
.AddShape(Type, Left, Top, Width, Height) | Excel Programming | |||
Error 1004 using Shapes.Range().Align | Excel Programming | |||
Shapes.AddPicture run-time error | Excel Programming |