+ Reply to Thread
Results 1 to 8 of 8

Tracking filename changes

  1. #1
    Registered User
    Join Date
    05-30-2013
    Location
    São Paulo, Brazil
    MS-Off Ver
    Excel 2010
    Posts
    12

    Tracking filename changes

    Hi,
    I already (unsuccessfully) searched for a way to track filename events, in order to trigger a macro (i.e. when a already document is opened, and then, saved with a new name).
    Is there a way to accomplish this?

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Tracking filename changes

    How would you like this "tracking" to function, outside the obvious if the current filename is changed to something new, trigger this macro... once triggered, what exactly is supposed to happen?
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    05-30-2013
    Location
    São Paulo, Brazil
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Tracking filename changes

    Hi JBeaucaire,

    Initially, for testing purposes I just want to display the MsgBox.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Tracking filename changes

    Put all of this code into the ThisWorkbook module, save, close, reopen, save with new name...

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-30-2013
    Location
    São Paulo, Brazil
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Tracking filename changes

    Thank you. I did as you said, but when saving (and renaming) the file, there's no action...
    I need to create an Excel addin (xlam) in order to use it as a template. In this case, shall I put the code on a module (I'm really newbie on it)?

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Tracking filename changes

    An Addin won't work. That is level of complexity greater than I can assist on.

    Here's my sample workbook and it is showing the popup messages...
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    05-30-2013
    Location
    São Paulo, Brazil
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Tracking filename changes

    Thank you again.

  8. #8
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Tracking filename changes

    For an add-in you need application-level events. At its simplest:

    In the ThisWorkbook module of your add-in:

    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

+ 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. Formula to return filename in folder based on partial filename
    By Rerock in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-26-2014, 12:28 PM
  2. [SOLVED] Find if filename exists and update variable within the filename structure
    By Lungfish in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 03-18-2013, 02:42 AM
  3. Code to create a custom .csv filename with version stamp in filename
    By Gti182 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-10-2012, 04:07 AM
  4. Replies: 3
    Last Post: 07-09-2012, 03:09 PM
  5. Replies: 0
    Last Post: 04-04-2006, 07:45 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