+ Reply to Thread
Results 1 to 3 of 3

Personal WB Macro- Dynamically name the "other" file

  1. #1
    Registered User
    Join Date
    03-02-2006
    Location
    USA
    MS-Off Ver
    O365 PC, Version 2207, 64bit
    Posts
    63

    Personal WB Macro- Dynamically name the "other" file

    When i open an excel file, two files actually open- the file I clicked on and the hidden Personal workbook. I have a macro saved in my Personal workbook so i can use it across many different files, but in order to do so, i need a way to name the file i actually clicked on, which will be dynamic.

    When i use ThisWorkbook.name it references the Personal, not the one I opened.

    Ideas???

  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: Personal WB Macro- Dynamically name the "other" file

    Hi, Remotruker,

    maybe like this:
    Please Login or Register  to view this content.
    Or even simpler as the personal workbook should be insvisible: use ActiveWorkbook instead of ThisWorkbook (which holds the code).

    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
    03-02-2006
    Location
    USA
    MS-Off Ver
    O365 PC, Version 2207, 64bit
    Posts
    63

    Re: Personal WB Macro- Dynamically name the "other" file

    Holger,
    This works!
    Thanks!

    Quote Originally Posted by HaHoBe View Post
    Hi, Remotruker,

    maybe like this:
    Please Login or Register  to view this content.
    Or even simpler as the personal workbook should be insvisible: use ActiveWorkbook instead of ThisWorkbook (which holds the code).

    Ciao,
    Holger

+ 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. [SOLVED] Whenever I open an Excel file, it also opens my "PERSONAL" macro workbook
    By MetroBOS in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-04-2014, 03:24 PM
  2. [SOLVED] personal.xls auto_open macro needs name of "trigger file"
    By Mike Bush in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-01-2012, 11:34 AM
  3. Perform macro "on open" specific file- store macro in Personal Macro Workbook?
    By thompssc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-17-2012, 12:38 PM
  4. Call a sub statement in "Personal Macro Workbook" from "ThisWorkbo
    By QC Coug in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-26-2005, 03:05 PM
  5. [SOLVED] Macro working in "This Workbook", but not while in "Personal.xls"
    By markx in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-07-2005, 01:06 PM

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