Consulting

Results 1 to 5 of 5

Thread: Filepath Variable

  1. #1

    Filepath Variable

    Hey All,
    I'm a little rusty with my VBA. I want to reference a file that will always be in the same directory as the excel book holding the VBA. Is there a variable I can use that will give me my workbook's location... Thanks!

    -Brian

  2. #2
    Administrator
    2nd VP-Knowledge Base
    VBAX Master malik641's Avatar
    Joined
    Jul 2005
    Location
    Florida baby!
    Posts
    1,533
    Location
    Yes,

    ThisWorkbook.Path




    New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.

  3. #3
    Worked perfectly. You wouldn't know of a similar feature for power point would you?

  4. #4
    Nevermind- it is ActivePresentation.Path

    Thanks!

  5. #5
    Administrator
    2nd VP-Knowledge Base VBAX Master malik641's Avatar
    Joined
    Jul 2005
    Location
    Florida baby!
    Posts
    1,533
    Location
    Something interesting to note:

    In the ThisWorkbook class module:
    Msgbox Me.Path

    In any Sheet class module:
    Msgbox Me.Parent.Path




    New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •