LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default Identify and delete the specified objects names

I used the following code that allows me to identify and delete a specific
object in the worksheet via a user interface. The code works this morning but
don't know why, when or how, this Runtime Error 1004: Application or
object-defined error. appears at the line every time the program tries to
delete the object. Someone suggested me to use clean registry but I have not
really tried it yet. Is there a way to avoid this problem? I hope to find a
simple way that can perform the same function as the following code? Your
advice or help will be greatly appreciated.

Thanks.

Public Sub Deleteonstrfr()
Dim Obj As Object

For Each Obj In Sheets("SLD").Shapes
If Left(Obj.Name, 7) = "onstrfr" Then
Obj.Delete '***Run-time Error found at here'
End If
Next Obj

End Sub
 
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
How can I identify source of objects from other files? Mr. G Excel Discussion (Misc queries) 2 November 23rd 09 01:19 PM
A formula to identify tab names in a worksheet Steve Excel Discussion (Misc queries) 3 April 22nd 09 11:46 PM
how to identify built-in Names Eric[_27_] Excel Programming 8 May 24th 05 03:32 AM
How do I build a Macro that can identify wooksheet names peter147 Excel Discussion (Misc queries) 4 May 22nd 05 04:26 PM
Get objects property names in run-time? Tom Ogilvy Excel Programming 0 February 13th 04 12:43 PM


All times are GMT +1. The time now is 11:57 PM.

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"