|
-
Jan 15th, 2004, 04:03 AM
#1
Thread Starter
Junior Member
*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.
-
Jan 15th, 2004, 04:11 AM
#2
-= B u g S l a y e r =-
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
-
Jan 15th, 2004, 04:44 AM
#3
Thread Starter
Junior Member
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
-
Jan 15th, 2004, 04:53 AM
#4
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"
-
Jan 15th, 2004, 04:57 AM
#5
-= B u g S l a y e r =-
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:
App.Path & "\peet_cheerleader.xls"
-
Jan 15th, 2004, 05:02 AM
#6
Thread Starter
Junior Member
thanks guys, i'll give it a go.
Cheers,
Arie
-
Jan 15th, 2004, 05:07 AM
#7
Originally posted by peet
oooh :D
VB Code:
App.Path & "\peet_cheerleader.xls"
We make such a lovely couple. :blushing:
-
Jan 15th, 2004, 05:25 AM
#8
-= B u g S l a y e r =-
-
Jan 15th, 2004, 08:25 AM
#9
Go and get a room 
Stop flaunting your love for each other in these forums!
-
Jan 15th, 2004, 01:43 PM
#10
Thread Starter
Junior Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|