+ Reply to Thread
Results 1 to 1 of 1

custom save and close sub causing other workbooks to crash

  1. #1
    Registered User
    Join Date
    05-14-2012
    Location
    Alaska, USA
    MS-Off Ver
    Excel 2007
    Posts
    31

    custom save and close sub causing other workbooks to crash

    Hello,
    I am new to VBA and don't understand code much, but I've plagarized bits of code off various internet locations to come up with what I have.
    In the attached spreadsheet, my objective is to record the user name and the time of the last save in the cells of my choice.
    Since several users access this spreadsheet to make changes, this will allow other users to see at a glance who was last in the file.

    If the user doesn't choose to enable macros, then the code won't run, so I found some code that creates a sort of 'welcome page' that forces the user to enable macros before he can view the sheet. the only catch is that the code seems to overwrite the programs default save and close routine, which is fine, except that it will only close the workbook, not the program, so that you then have to close the program also.

    This is not a big deal, except for in the following scenario:

    A user has a separate workbook open in Excel. With that workbook open, he then opens my workbook. After making desired changes, he closes my workbook. The dialog box asks if he wants to save, and gives three options: yes, no, or cancel.

    If he chooses cancel or yes, all is well. But if he chooses no, my workbook will close, and the workbook he had open previously will crash.

    I have no idea what to do with this.
    Attached Files Attached Files

+ Reply to Thread

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