Results 1 to 10 of 10

Thread: *RESOLVED* how to put path of application in a variable?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2004
    Posts
    16

    Question *RESOLVED* how to put path of application in a variable?

    This is probably a noob question, but i'm still new to vb so please excuse me.

    I'm creating just a simple application with just one form with some buttons to open different excel files. My form is thus not much more than a gateway to different .xls files. The users clicks a button and the according .xls file needs to open. The problem is that the .exe file (which opens the form) can be anywhere on the users pc, so i need to know the path so i can make the link to the .xls files.
    Does anyone know how i can put the path (of the program) into a variable? i've tried application.path but that just gives me the path to the office folder.
    Thanks in advance!

    Cheers,
    Arie
    Last edited by arie ribbens; Jan 15th, 2004 at 01:44 PM.

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    you using vb or vba ?

    the exe you talk about is that your exe compiled from vb ? or the excel.exe file ?

    you use app.path if you use vb
    -= a peet post =-

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jan 2004
    Posts
    16
    Thanks for your reply peet!
    i used vb to make the .exe. As far as i know it's not possible to compile .exe files from vba.
    The .exe file i talk about is the compiled exe (i need to know the path of this .exe file)
    Is app.path different then application.path? Because application.path doesn't seem to do the job. It gives me the path to an office folder (before it starts excel)

    Cheers,
    Arie

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Originally posted by arie ribbens
    Thanks for your reply peet!
    i used vb to make the .exe. As far as i know it's not possible to compile .exe files from vba.
    The .exe file i talk about is the compiled exe (i need to know the path of this .exe file)
    Is app.path different then application.path? Because application.path doesn't seem to do the job. It gives me the path to an office folder (before it starts excel)

    Cheers,
    Arie
    There is no "Application.Path" in VB.

    It's App.Path, and so your string would look something like this:

    App.Path & "peet_cheerleader.xls"

  5. #5
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    Originally posted by mendhak
    There is no "Application.Path" in VB.

    It's App.Path, and so your string would look something like this:

    App.Path & "peet_cheerleader.xls"
    oooh

    VB Code:
    1. App.Path & "\peet_cheerleader.xls"
    -= a peet post =-

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Jan 2004
    Posts
    16
    thanks guys, i'll give it a go.

    Cheers,
    Arie

  7. #7
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Originally posted by peet
    oooh :D

    VB Code:
    1. App.Path & "\peet_cheerleader.xls"
    We make such a lovely couple. :blushing:

  8. #8
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    -= a peet post =-

  9. #9

  10. #10

    Thread Starter
    Junior Member
    Join Date
    Jan 2004
    Posts
    16
    tried it and it works...thanks lovebirds

    Cheers,
    Arie

Posting Permissions

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



Click Here to Expand Forum to Full Width