+ Reply to Thread
Results 1 to 3 of 3

How to inject from outside (!) a macro into an Excel doc/file?

  1. #1
    Registered User
    Join Date
    04-02-2009
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    40

    How to inject from outside (!) a macro into an Excel doc/file?

    As I understand Macros are defined per single MS Office document and stored in the document file itself.

    There is no such option as a system-wide definition of a macro for new as well as for already existing old excel documents.
    I don't want to fiddle around with *.dot pattern files (which are not applicable to old files).

    This is very annoying.

    So my idea is to setup a batch file or program onto which I can drag&drop an excel document file and which automatically
    injects/adds pre-defined user macros so that they are later available from inside.

    Even better I could think of a tool which traverses a user defined directory tree and injects the pre-defined user macros into
    all found Excel files it finds there.

    Is this possible?

    How exactly can I inject Makros into an Excel 2007 document file?

    Peter

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

    Re: How to inject from outside (!) a macro into an Excel doc/file?

    Hi, Peter,

    maybe have a read about *.xlam before copying lots of code into workbooks and change the format for those as well.

    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

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2506 Win 11
    Posts
    24,779

    Re: How to inject from outside (!) a macro into an Excel doc/file?

    Suggest you look at this link

    http://www.rondebruin.nl/win/personal.htm
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ 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. Converting excel 2003 file ext macro file-save code to reflect excel 2007 exts
    By pmanoloff in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-20-2013, 12:17 PM
  2. macro prompts immediately to open a file once the Excel file with the macro is opened
    By jhmayor03 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-03-2012, 10:00 AM
  3. Inject date in cell with one of three cells changed
    By daowen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-24-2009, 10:45 AM
  4. Replies: 0
    Last Post: 06-09-2008, 12:00 PM
  5. Macro to automate filter >= "inject todays date here"
    By carlstev in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-16-2007, 09:12 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