Is there a method that VB uses to get the drive letter of the directory where the program files reside witout specifying it explicitly? :rolleyes:

If I understand correctly. You can use the stored system variables:

Debug.Print Environ("PROGRAMFILES")

'OR if you want just the drive letter you can also use

Debug.Print Environ("HOMEDRIVE")

'OR

Debug.Print Environ("SYSTEMDRIVE")

Find a large list of these variables here and what they are all about: http://vlaurie.com/computers2/Articles/environment.htm

The path where the project file resides can be gotten (as a string) using App.Path

Hi,

Use

MsgBox "My program Is In drive : " & Left(App.Path,1)

Regards
Veena

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.