+ Reply to Thread
Results 1 to 2 of 2

Macro that runs on the SaveAs (PDF) event and not the Save event

  1. #1
    Registered User
    Join Date
    01-07-2018
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    6

    Question Macro that runs on the SaveAs (PDF) event and not the Save event

    Good evening everyone,

    I am working on a workbook with several pages. On each page I am trying to setup a macro that run when the SaveAs event is activated (i.e. when the end user clicks a button to save the current worksheet as a PDF). The macro would add the current date and time (i.e. =NOW()) to a specific cell (B5). Then another macro would activate based on cell B5 now having a value in it. This macro will run on the worksheet change event to highlight (fill with bright orange) any cell that is changed.

    The overall idea is that the end user can make updates/changes to a schedule as often as they want and then save the schedule to a pdf. From that save to pdf point onward anything changed on the schedule will be highlighted orange. I am not sure if my idea to have the saveas event fill a cell that then triggers the macro for onchange will work or is the best way. Does anyone have any ideas?

    Thank you very much for your help on this!

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Macro that runs on the SaveAs (PDF) event and not the Save event

    To save as pdf you would use ExportAsFixedFormat instead of SaveAs.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

+ 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] Event macro runs in wrong workbook/doesn't work properly
    By VBA FTW in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-30-2012, 11:28 AM
  2. Replies: 4
    Last Post: 11-07-2012, 04:02 PM
  3. Before save event macro
    By certain_death in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-08-2010, 05:47 AM
  4. Before Save event macro
    By certain_death in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-09-2009, 01:56 PM
  5. Running Macro on Save Event
    By lxndeb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-30-2009, 02:47 PM
  6. Before Save event macro
    By certain_death in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-08-2009, 10:06 AM
  7. Before Save event macro
    By certain_death in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-28-2009, 07:45 AM
  8. Macro after save event
    By Ada01 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-17-2008, 02:08 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