none
Trying to Use VBA to import a module into personal.xlsb RRS feed

  • Question

  • I'm trying to find a simple code to import a module into a personal macros file.  I have several other users who need to access some macros I have created, without having to open a "macros file" every time they want to run them.  I have come across this kind of code on other forums:

    ActiveWorkbook.VBProject.VBComponents.Import ("c:\exportedmodule.bas")

    This will import the module into whatever file they currently have active, but I want to be able to import specifically into personal.xlsb one time, and be done with it, and I can't find the correct code for this.  Any help would be appreciated.

    Wednesday, May 22, 2013 7:02 PM

All replies

  • This is not good way.

    You cant have two or more procedures same name. You should to look it in repository to delete before code'll copy. So the best way is distribute addinn (XLAm or COM/VSTO thru install file) 


    Oskar Shon, Office System MVP

    Press if Helpful; Answer when a problem solved

    • Proposed as answer by Shasur Monday, May 27, 2013 4:54 AM
    Thursday, May 23, 2013 1:15 PM
    Answerer
  • Used .xlam, that did the trick.  Easy as pie.  Thanks!
    Tuesday, May 28, 2013 12:03 PM