+ Reply to Thread
Results 1 to 2 of 2

workbook_beforesave fires but doesn't do anything when triggered by thisworkbook.save

  1. #1
    Valued Forum Contributor
    Join Date
    10-13-2010
    Location
    Sunderland, England
    MS-Off Ver
    Excel 2007 (Home) / 2003 (Work)
    Posts
    740

    workbook_beforesave fires but doesn't do anything when triggered by thisworkbook.save

    Hey guys, it's been a while. I'm having a real headache with some VBA on a workbook. The goal is to autosave every time a specific button is clicked on a userform:

    Please Login or Register  to view this content.
    When it reaches the activeworkbook.save line at the end, it fires up the workbook_beforesave command. However, even though the code fires, it doesn't DO anything. I can F8 through the code, and it seems to run, but when it gets to a sht.visible=False line, for instance, nothing happens. Same with thisworkbook.save. It just completely ignores what it's reading. When I click 'Save' manually, the code runs perfectly. Any ideas what might be causing the issue? Am I doing something stupid here?

    Workbook_beforesave code:

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    10-13-2010
    Location
    Sunderland, England
    MS-Off Ver
    Excel 2007 (Home) / 2003 (Work)
    Posts
    740

    Re: workbook_beforesave fires but doesn't do anything when triggered by thisworkbook.save

    Just to add, I still haven't discovered why this doesn't work, but I've found a workaround by putting the workbook_beforesave code into a standalone module and then running the module at the end instead of the activeworkbook.save line.

+ 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. [SOLVED] Mouse fires SpinButton once, keyboard fires SpinButton twice
    By 79590 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-10-2015, 04:33 PM
  2. Bringing up a save as dialogue box after a workbook_beforesave event
    By chriskhoo87 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-22-2015, 06:31 AM
  3. ThisWorkbook Doesn't Launch Sometimes
    By davidzzzz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-02-2013, 09:12 PM
  4. [SOLVED] ComboBox Triggered VLOOKUP Doesn't Work Because Of Format
    By nevi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-11-2012, 01:55 AM
  5. Restoring Save functions after Workbook_BeforeSave
    By jagman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-29-2007, 12:35 AM
  6. Workbook.Save triggers event Workbook_BeforeSave and things don't work!
    By Dean Meyer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-12-2006, 01:05 PM
  7. No screen updating in Workbook_BeforeSave event after ActiveWorkbook.Save
    By bmeijers in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-29-2005, 09:51 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