+ Reply to Thread
Results 1 to 4 of 4

Locating XLAM in same directory where XLSM is

  1. #1
    Registered User
    Join Date
    10-09-2012
    Location
    Dresden, Germany
    MS-Off Ver
    Excel 2007
    Posts
    3

    Locating XLAM in same directory where XLSM is

    Hi everybody!

    My problem in Excel 2010 is like this :

    There is an Excel file XLSM using some functions and macros containing in an XLAM file. Separate instances of this XLSM file are used by different people, each of them have an own data set in a personal file. This file can be stored on a movable medium like an USB-Stick. The file XLAM is under ongoing development and gets sometimes modified.
    Now I would like to locate this XLAM file in the same directory where also the XLSM is - it means probably on a movable medium as well. The idea is that a modified XLAM can be simply downloaded by a person using XLSM and will serve it with the modified functions or macros, preserving the unique data contents of the relating XLSM. The USB stick can be taken to another computer and the XLSM will be usable with the copy of XLAM stored on the USB, even if on this computer there is some local copy of the XLAM, located in the AddIn path.

    The point of my problem : How can I teach the XLSM that it should always use the XLAM stored in the same directory? -- something like "..\ABC.XLAM" without indicating the full path that may be different on different computers.

    Any kindly assistance would be highly appreciated.

    Regards

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

    Re: Locating XLAM in same directory where XLSM is

    Hi, Locateur,

    you might be looking for ThisWorkbook.Path to get the path of the XLSM independant of any drives.

    Just one additional question: how will you maintain the same version on all distributed and disloacted XLAM?

    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
    Registered User
    Join Date
    10-09-2012
    Location
    Dresden, Germany
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Locating XLAM in same directory where XLSM is

    Hallo Holger,

    first an answer to your question : The users of XLAM will actualize their copies themselves. I will only inform them about a new release.

    However, I don't beleive that ThisWorkbook.Path can be a solution in my case.

    Normally, an AddIn XLAM gets installed on each computer somewhere in a permanently accessible path like C:/Users/SomeUser/.../Add-In. When the user opens his local copy of XLSM the Excel opens a stored in that path XLAM and uses its functions and macros.
    But you cannot specify this path connected to an USB stick. Because the stick may get different drive letter every time it gets installed on the same computer. And Excel wants to have the AddIn path specified in the Excel software, not in the XLSM file. Or am I wrong?

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

    Re: Locating XLAM in same directory where XLSM is

    Hi, Locateur,

    what you have described is the standard way with an addin installation. Working around a standard place is for one the concept to place a link to the addin in the startup path of excel - the addin will be loaded whereever it is located. This won´t be of any use for your project as I understand it.

    And working with yet another workbook would maybe help with locating both other workbooks and opening them for work but that would also mean that these workbook could not be operated solely. I will have to test thoroughly before I come back to you about this.

    Ciao,
    Holger

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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