+ Reply to Thread
Results 1 to 3 of 3

Creating and Inserting a Macro into a New Workbook

  1. #1
    Forum Contributor
    Join Date
    07-07-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    500

    Creating and Inserting a Macro into a New Workbook

    Greetings,
    I am using "SaveCopyAs" to create a new Workbook. I would like to create and insert a macro into the "ThisWorkbook" for the new Workbook, to initialize when the new Workbook is opened. I do not want for the macro to be on the existing Workbook.

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Creating and Inserting a Macro into a New Workbook

    I'd not recommend doing that. As there are several issues associated.

    Have a read of link.
    http://www.cpearson.com/Excel/VBE.aspx

    I'd recommend, including check to disable macro based on workbook name (or some other check), have it in the existing workbook and SaveCopyAs.
    "Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something."
    ― Robert A. Heinlein

  3. #3
    Forum Contributor
    Join Date
    07-07-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    500

    Re: Creating and Inserting a Macro into a New Workbook

    CK76,
    Thank you much for the suggestion - it is working perfectly!!

+ 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. Creating Macro using Active Workbook
    By NancyPez in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-05-2015, 12:04 PM
  2. Inserting a worksheet into another workbook loses its macro in the journey
    By Bill Allen in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-03-2014, 11:40 PM
  3. Macro for copying & inserting a variable number of rows into a separate workbook
    By Gunther Maplethorpe in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-01-2013, 06:26 PM
  4. [SOLVED] Creating a macro to apply to another workbook
    By Brumbot in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-22-2013, 04:32 AM
  5. [SOLVED] Need a macro for creating payslip using auto vlookup and inserting and renaming sheet
    By srinivasan1965 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-08-2012, 01:17 AM
  6. Macro for inserting code into another workbook, to run when opened
    By hriggs in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-19-2009, 11:07 AM
  7. creating new workbook macro
    By LindaM in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-18-2005, 10:06 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