![]() ![]() ' This sub will automatically start when xlam file is opened (both install version and installed version) Dim oAddIn As Object, oXLApp As Object, oWorkbook As Workbookĭim i As Integer Dim iAddIn As Integer Dim bAlreadyInstalled As Boolean Dim sAddInName As String, sAddInFileName As String, sCurrentPath As String, sStandardPath As String install.xlam in the proper excel directory ' The install package will be name ' During install you may be prompt to enable macros (accept it) ' You can accept to install or refuse (which let you modify the XLAM file macros or install procedure ' Set it to True to be able to Debug install mechanism Const bVerboseMessages = False ' Will be use to verify if the procedure has already been run Dim bAlreadyRun As Boolean Private Sub Workbook_Open() Here is the code to add to “ThisWorkbook”: Option Explicit ' (c) Willy Roche (willy.roche(at)) ' Install procedure of XLAM (library of functions) ' This procedure will install a file name. If you want to update your XLAM later on, you just double-click it, enable macros as needed and refuse to install it. In order to share/install your XLAM, you now just have to ask the user to double-click the XLAM file, enable macros as needed and accept to install the Add-In. – Add the following procedures to the “This workbook” section in VBE – Open it and edit in Visual Basic Editor (VBE) ![]() ![]() (Otherwise Excel has an “Sorry, Excel can’t open two workbooks with the same name at the same time.” In order to differentiate the installation file and the installed file, the install version is named “.install.xlam” and the installed version is just named “.xlam”. I created an automatic install procedure to be added to the “This Workbook” section of the XLAM file, so that it’s automatically run when file is open. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |