Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I am trying to delete a shape from a sheet with: ActiveSheet.Shapes("AAPicture").Select Selection.Delete I need to verify first that the shape exists so the user wont get an error that the object doesnt exists. How can i do that? Thanks, |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi vandaley
One way is to use on error On Error Resume Next ActiveSheet.Shapes("AAPicture").Delete On Error GoTo 0 -- Regards Ron de Bruin http://www.rondebruin.nl "vandaley" wrote in message ups.com... Hi, I am trying to delete a shape from a sheet with: ActiveSheet.Shapes("AAPicture").Select Selection.Delete I need to verify first that the shape exists so the user wont get an error that the object doesnt exists. How can i do that? Thanks, |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks ,
Seems to do the trick. Ron de Bruin wrote: Hi vandaley One way is to use on error On Error Resume Next ActiveSheet.Shapes("AAPicture").Delete On Error GoTo 0 -- Regards Ron de Bruin http://www.rondebruin.nl "vandaley" wrote in message ups.com... Hi, I am trying to delete a shape from a sheet with: ActiveSheet.Shapes("AAPicture").Select Selection.Delete I need to verify first that the shape exists so the user wont get an error that the object doesnt exists. How can i do that? Thanks, |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
how about this one: Dim s As Shape For Each s In ActiveSheet.Shapes If s.Name = "Test" Then MsgBox "shape Test exists" exit for End If Next "Name" seems to be case sensitive. -- Greetings from Bavaria, Germany Helmut Weber, MVP WordVBA Win XP, Office 2003 "red.sys" & Chr$(64) & "t-online.de" |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
verify if spesific sheet exist | Excel Discussion (Misc queries) | |||
verify a path exists | Excel Programming | |||
Verify if sheet name still exist | Excel Programming | |||
How can I know if a sheet exists ? | Excel Programming | |||
Verify a directory exists | Excel Programming |