+ Reply to Thread
Results 1 to 3 of 3

Workbook path when using Add-In

  1. #1
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Workbook path when using Add-In

    Okay, I have 3 macros below for saving things. In each I originally had "ThisWorkbook.Path", in the macros, but each one instead of saving to Active workbook path saved to where the Add-In lives. So I went looking for help, and ran across this:http://www.techrepublic.com/blog/mic...-excel-macros/
    So, I changed to "ActiveWorkbook.Path". Guess what? All 3 macros STILL save to where the Add-In lives. HELP!

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,837

    Re: Workbook path when using Add-In

    May need a sample file. I have a similar macro in my macros collection, and I have not experienced the same problem. Relevant code
    Please Login or Register  to view this content.
    The only trouble I have ever had is in the case of brand new workbooks before they have been saved where the workbook doesn't have a path, yet.

    I would probably put a "stop" statement after your "filename = ActiveWorkbook.Path & "\textfile-" & Format(Now, "ddmmyy-hhmmss") & ".txt"" statement (maybe earlier). Then, when VBA enters debug mode, I would check to see what is going on. What value has been stored in filename? What workbook is active?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: Workbook path when using Add-In

    Sometimes my level of stupidity astounds me. The workbook I was testing on sits in the same folder as my add-in. D-Uh! Sorry.

+ 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. Import data to a workbook from another workbook with relative path
    By kexet77 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-19-2015, 08:03 AM
  2. Import "|" delimitted files into workbook - Saving that workbook (determine path)
    By schmidt1962 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-23-2013, 11:28 AM
  3. Replies: 5
    Last Post: 03-21-2013, 07:34 AM
  4. Export worksheets from a workbook to the current workbook location path
    By legendkiller420 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-22-2010, 04:08 AM
  5. Workbook.Path
    By Fred in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-08-2006, 07:40 PM
  6. [SOLVED] New Workbook Path
    By exceluserforeman in forum Excel General
    Replies: 2
    Last Post: 12-06-2005, 08:15 PM
  7. [SOLVED] Workbook path
    By nc in forum Excel General
    Replies: 2
    Last Post: 04-04-2005, 11:06 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