+ Reply to Thread
Results 1 to 2 of 2

Macro code to automatically save and exit after 2 minutes!

  1. #1
    Registered User
    Join Date
    01-30-2014
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    4

    Post Macro code to automatically save and exit after 2 minutes!

    Hi, I am struggling with some coding. I want the code to run the macro from the workbook opening and after 2 minutes, save and automatically close. So far, I can get it to save and close but I have to run the macro manually.

    Any help would be great!!!

    Thanks

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Macro code to automatically save and exit after 2 minutes!

    Hi, Garth2014,

    you would have to use OnTime in Workbook_Open, Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) and Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range) (all located in ThisWorkbook).

    HTH,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

+ 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. Macro to save automatically excel sheet in every 2 minutes
    By bittu2010 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-12-2012, 11:14 AM
  2. Code to Exit a Macro
    By AccountantCost in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-06-2009, 02:06 PM
  3. Save and Exit Macro
    By BKM in forum Excel General
    Replies: 1
    Last Post: 11-27-2006, 01:55 PM
  4. [SOLVED] running macro at save/close/exit
    By Pedro in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-03-2006, 08:40 AM
  5. Write macro don't ask to save when exit excel
    By Rui Alvares in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-28-2006, 07:55 PM

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