+ Reply to Thread
Results 1 to 2 of 2

Macro to run when another workbook is saved

  1. #1
    Forum Contributor
    Join Date
    10-04-2006
    Posts
    151

    Macro to run when another workbook is saved

    Good Day, fellow Exceller's.

    I am facing a challenge I am uncertain can be addressed by Excel.

    Is there a way for a macro to run, (we will call it "Test.xlsx"), when the workbook "Test2.xlsx" is saved?

    So, when Test2.xlsx is saved, Test.xlsx says "Hey! Test2.xlsx has been updated! Time to run our macro!"

    So basically I'm looking for a macro to run in one workbook, when another workbook has been saved.

    Can this be accomplished with Excel? I have Googled for quite some time and am unable to find a solution to this.

    Your time and energies are appreciated.

    Regards,

    NEU

  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 to run when another workbook is saved

    Hi, Neu,

    you may get there by using class programming and either add the code to run in your personal macro workbook or in an AddIn to be active upon opening Excel in normal mode. Since you are not looking for a nomral macro to be started by macro but by event and you want the code to work for macro-free workbooks that should be the way go. You may start looking at Classes in VBA to get some information about what the subject may look like.

    Sample for the code may look like this. Enter a new Class Module and name it XLEvents. Code for XLEvents:
    Please Login or Register  to view this content.
    In a stanard module:
    Please Login or Register  to view this content.
    Code for ThisWorkbook:
    Please Login or Register  to view this content.
    Ciao,
    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. how to exit macro if workbook saved
    By sspreyer in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-25-2013, 03:16 PM
  2. [SOLVED] Macro to stop workbook being saved
    By bouncingbudha in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-01-2013, 02:35 PM
  3. Is it possible to open a Workbook saved on a website with a Macro
    By Carling73 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-30-2013, 03:26 AM
  4. Need macro to show that workbook has been saved
    By rkjudy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-25-2009, 02:31 PM
  5. How do you run macro automatically each time workbook is saved?
    By Husker87 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-25-2005, 11:00 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