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 Run-time error for objects deletion

Hi,

I have made a list of option button. When I select a particular option, the
excel should identify and delete the previous object names starting with
"onstrfr". However, when it identifies the correct obj name "onstrfr", the
obj.Delete gives "Run-time error '1004': Application-defined or
object-defined error".

I'll be grateful if someone can help me to solve this problem.

Loy
=== FROM Sheet1=======
Private Sub on3wdgtrfroption_Click()
Call Sheet2.Deleteonstrfr
Call Sheet2.OnshoreTrfr(myValue, 2)
End Sub

===From Sheet2========

Sub Deleteonstrfr()
Dim Obj As Object
For Each Obj In ThisWorkbook.Sheets("SLD").Shapes
If Left(Obj.Name, 7) = "onstrfr" Then
MsgBox Obj.Name
Obj.Delete
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
Selecting objects for deletion in 2007 Squeaky Excel Discussion (Misc queries) 7 May 5th 09 10:12 PM
setting error handling on control creation and deletion joe Excel Programming 0 February 22nd 06 02:35 PM
Cannot shift objects error beefycj5 Excel Discussion (Misc queries) 1 August 2nd 05 06:20 PM
Get objects property names in run-time? Tom Ogilvy Excel Programming 0 February 13th 04 12:43 PM
Run-time error '1004' running to excel objects at once Dianna Braden Excel Programming 0 October 16th 03 08:55 PM


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