+ Reply to Thread
Results 1 to 3 of 3

Is it possible to replace this hard coded file name with a constant or variable?

  1. #1
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Is it possible to replace this hard coded file name with a constant or variable?

    I have the following code:

    Please Login or Register  to view this content.
    MyTestAddIn_v2.xlam is the name of a XLAM file. (This is not the name of the workbook containing the above code).

    Would it be possible to set the add-in name as a constant or string variable somewhere in the same project and then have this constant/variable called from the Application.Run line? (My aim is to avoid hard-coding the name into this particular sub)

    I have tried doing this but I quickly ran into trouble with the 's & "s. So - Is it possible to do this or not?
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Is it possible to replace this hard coded file name with a constant or variable?

    Try something like this...

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Is it possible to replace this hard coded file name with a constant or variable?

    So THAT'S how you do it!

    It worked, Thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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