+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    11-14-2007
    Posts
    91

    Deleting sheets with local names - ver 2007 vs ver 2003

    I have some workbooks written under Excel 2003 (or earlier).

    Some of them contain VBA macros to delete selected worksheets.
    The reason that these were coded into VBA macros rather just using the built-in menu option to delete sheets was because where the workbook contained defined names that were local to the sheet, deleting the sheet did not delete the defined ranges - they just hung around as global names filled with #Ref! errors. The VBA macros had the effect of deleting all defined names local to the selected sheet before deleting the sheet.

    Now I am beginning to look at Excel 2007, and it looks to me that this procedure may no longer be necessary, otherwise than for backward compatibility (in case someone decides to open it in an earlier version of Excel). Have I got this right, please, that in Excel 2007 the act of deleting a worksheet via the normal non-VBA method also deletes the local names?

    Also, I did notice in Excel 2003 there was some instability if you used Excel 1995 macros such as GET.WORKBOOK(1) in a defined name and then tried to copy worksheets etc. Have those instabilities cleared up in Excel 2007, or is it still regarded as unstable to use those features?

    Thanks.
    Last edited by 1eyedjack; 02-21-2010 at 05:31 PM.

  2. #2
    Forum Moderator shg's Avatar
    Join Date
    06-21-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007
    Posts
    25,137

    Re: New to Excel 2007, but not to 2003

    Please take a few minutes to reread the forum rules, and then amend your thread title accordingly.

    Thanks.
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forums Administrator royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    24,447

    Re: New to Excel 2007, but not to 2003

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
    Check out the free Excel Toolbar

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)


    Code Tags: Make your code easier for us to read

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0