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: 153
Default Shapes and protection xl2000/2003

Hello everyone,

I’ve tried searching the various groups, but I haven’t come across
anything that quite addresses this.

I have the following code, dummied down from a large application.
Basically, running the code with Sheet1 active, deleting a shape(s)
from Sheet2.

Sub deleteShape()

Dim Shp As Shape

Sheet1.Protect , True, True, True, True
Sheet2.Protect , True, True, True, True

' Sheet1.Protect , False
Sheet2.Protect , False

For Each Shp In Sheet2.Shapes
Shp.Delete
Next Shp

End Sub

As it stands, the code works as expected with xl2007. However, it
will kick out a 1004 error running under xl2000 or 2003 at the
Shp.Delete line. I can get it to work by either uncommenting the line
“Sheet1.Protect, False”, or, by keeping Sheet2 active. Also runs ok
if Sheet3 is active (unprotected sheet). In other words, it seems as
if the active sheet has to be unprotected, in addition to sheet2.

If someone could confirm that this is correct, I would be most
obliged. I ran into this at the last minute, (application developed
in xl2007), expected to do a few quick tests with xl2003 and be done
with it. Well, 3 hours later . . .;-)

Regards,

DaveU
 
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
Excel 2003 - Shapes Mike Faulkner Excel Programming 6 July 7th 08 07:34 PM
Shapes in 2007 from 2003 WayneR Excel Discussion (Misc queries) 0 May 23rd 08 08:16 PM
XL2000/2003 Compatibility Issue Terry Detrie[_2_] Excel Programming 2 December 4th 06 11:40 PM
COM interop XL2000 vs 2003 Rick Humphrey Excel Programming 3 July 9th 06 11:14 PM
ColorIndex property XL2000 vs 2003 MarkT Excel Programming 10 March 18th 05 05:09 PM


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