Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Run time error 1004 generated in Excel (Office 2003)

I have code originally generated in excel (office 97). The code is a
simple maco which runs when shape (which looks like a Button) held on a
worksheet is clicked.

One of the requirements is that the button should be deleted from the
worksheet to stop the code being accidentally re-run. The following
code works in Office '97 but generates a run time error in 2003

If IsAnyShape(wsSrc) = 1 Then
wsSrc.Shapes("ImpPhotoBut").Delete

End If

Where IsAnyShape tests for the existence of a shape
wsSrc is a worksheet variable
ImpPhotoBut is the name given to the shape

Incidentally 'wsSrc.Shapes(1).Delete' delivers the identical error.

Any thoughts on why the error occurs in the later software platform and
/or a workaround for this code.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 415
Default Run time error 1004 generated in Excel (Office 2003)

The.Delete works for me in XL2K.
What is the IsAnyShape function ?

NickHK


groups.com...
I have code originally generated in excel (office 97). The code is a
simple maco which runs when shape (which looks like a Button) held on a
worksheet is clicked.

One of the requirements is that the button should be deleted from the
worksheet to stop the code being accidentally re-run. The following
code works in Office '97 but generates a run time error in 2003

If IsAnyShape(wsSrc) = 1 Then
wsSrc.Shapes("ImpPhotoBut").Delete

End If

Where IsAnyShape tests for the existence of a shape
wsSrc is a worksheet variable
ImpPhotoBut is the name given to the shape

Incidentally 'wsSrc.Shapes(1).Delete' delivers the identical error.

Any thoughts on why the error occurs in the later software platform and
/or a workaround for this code.



Reply
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
Run time error 1004 When running in 2003 Lakshman Excel Discussion (Misc queries) 10 January 17th 07 06:06 PM
Run-time error '1004' VBA Excel 2003 pltang Excel Programming 1 July 19th 06 11:15 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
EXCEL VBA - Run-time Error 1004 sakieboy Excel Programming 5 January 30th 04 03:47 PM
EXCEL VBA - Run-time Error 1004 sakieboy[_3_] Excel Programming 0 January 29th 04 02:27 PM


All times are GMT +1. The time now is 12:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"