+ Reply to Thread
Results 1 to 5 of 5

Rename sheet in workbooks(2) changes workbooks(1) saved status

  1. #1
    Registered User
    Join Date
    11-08-2006
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    37

    Rename sheet in workbooks(2) changes workbooks(1) saved status

    The setup:

    Workbooks(1) is open in the background
    A cell in a worksheet in Workbooks(1) contains an Offset formula - e.g. =OFFSET($A$1,0,2,1,1)
    There are no external references in Workbooks(1)
    Workbooks(2) is open in the foreground

    Open the VBE and in an Immediate window....

    workbooks(1).Saved=True
    ?workbooks(1).Saved
    >> True
    activesheet.name="asdfg"
    ?workbooks(1).Saved
    >> False

    So nothing has been done to Workbooks(1) and there are no references in Workbooks(1) to Workbooks(2) but the saved status of Workbooks(1) changes when a worksheet in Workbooks(2) is renamed. It's the same in Excel 2010 and 2013. This looks like a bug to me but maybe I'm missing something?

    Regards, AB

  2. #2
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Rename sheet in workbooks(2) changes workbooks(1) saved status

    I doesn't seem to work that way for me. Try it with two different workbooks and see if the results are the same.
    Acts 4:12
    Salvation is found in no one else, for there is no other name under heaven given to mankind by which we must be saved.

  3. #3
    Registered User
    Join Date
    11-08-2006
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    37

    Re: Rename sheet in workbooks(2) changes workbooks(1) saved status

    Quote Originally Posted by natefarm View Post
    I doesn't seem to work that way for me. Try it with two different workbooks and see if the results are the same.
    I have tried with different workbooks and on two different PCs - W7 laptop with Excel 2013 and W8.1 desktop with Excel 2010.

    Regards, AB

  4. #4
    Registered User
    Join Date
    11-08-2006
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    37

    Re: Rename sheet in workbooks(2) changes workbooks(1) saved status

    Here's the test code I use in the primary workbook. The STOP statement lets me step through to see what is going on line by line.
    Please Login or Register  to view this content.
    The secondary workbook should be called S.xlsx and placed in the same folder as the primary P.xlsm workbook. In my test case the single worksheet looks like this...

    XLbug-01.png

    Regards, AB

  5. #5
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Rename sheet in workbooks(2) changes workbooks(1) saved status

    I modified it to open Book1.xlsm from my desktop, and it still worked like it should for me, so in Book1 I added a formula, =NOW(), and saved and closed it. Then when I reopen it, it behaves as you describe. My guess is that changing the sheet name causes formulas to recalculate and it resets Saved back to false. I changed my formula to a different formula (=A1) and it went back to working correctly, so if you have a formula somewhere in the workbook being opened that gets the current time, that may be the culprit. I don't know if it has to do with you renaming the sheet to include the current time, of if that's a coincidence.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. merging first sheet of several workbooks saved in one file
    By mariellam in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-13-2014, 02:28 PM
  2. Rename 15 workbooks based on the inputs in the instructions sheet
    By rshnkmr39 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-28-2013, 02:00 PM
  3. Rename the first worksheet of many workbooks
    By takispv in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-18-2012, 08:20 PM
  4. Stop workbooks from being saved
    By BarryTSL in forum Excel General
    Replies: 8
    Last Post: 02-04-2011, 01:50 PM
  5. [SOLVED] Cannot edit workbooks saved to CD
    By BP in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-18-2005, 08:06 AM

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.6.0 RC 1