PC Review


Reply
Thread Tools Rate Thread

Avoiding an error

 
 
Francis Hookham
Guest
Posts: n/a
 
      10th Apr 2007
I have a situation where a named Text Box may or not have been deleted.

So

Sheets("Schedule").Shapes("JobTextBox").Delete

produces an error if the TextBox has already been deleted.



Any suggestions?



Francis Hookham


 
Reply With Quote
 
 
 
 
Norman Jones
Guest
Posts: n/a
 
      10th Apr 2007
Hi Francis,

One way:

'=============>>
Public Sub Tester()
Dim SHP As Shape

On Error Resume Next
Set SHP = Sheets("Schedule").Shapes("JobTextBox")
On Error GoTo 0

If Not SHP Is Nothing Then
SHP.Delete
End If

End Sub
'<<=============

---
Regards,
Norman


"Francis Hookham" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have a situation where a named Text Box may or not have been deleted.
>
> So
>
> Sheets("Schedule").Shapes("JobTextBox").Delete
>
> produces an error if the TextBox has already been deleted.
>
>
>
> Any suggestions?
>
>
>
> Francis Hookham
>



 
Reply With Quote
 
=?Utf-8?B?VmVyZ2VsIEFkcmlhbm8=?=
Guest
Posts: n/a
 
      10th Apr 2007

On Error Resume Next
Sheets("Schedule").Shapes("JobTextBox").Delete
On Error Goto 0



--
Hope that helps.

Vergel Adriano


"Francis Hookham" wrote:

> I have a situation where a named Text Box may or not have been deleted.
>
> So
>
> Sheets("Schedule").Shapes("JobTextBox").Delete
>
> produces an error if the TextBox has already been deleted.
>
>
>
> Any suggestions?
>
>
>
> Francis Hookham
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Avoiding a #n/a error brian.baker13@googlemail.com Microsoft Excel Discussion 3 4th Mar 2008 10:56 AM
Avoiding hyperlink error =?Utf-8?B?QUJhbHVzdQ==?= Microsoft Excel Programming 0 18th Oct 2007 05:08 PM
Avoiding the dreaded #div/0 error Marie1uk Microsoft Excel Worksheet Functions 10 21st Jul 2005 10:49 PM
Avoiding 400 Error code =?Utf-8?B?bm9zcGFtaW5saWNo?= Microsoft Excel Programming 2 2nd Feb 2005 07:55 PM
avoiding debug error R D S Microsoft Excel Misc 3 25th Jun 2004 10:14 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:08 PM.