Hi all,

I recently upgraded an application I had in VB 6 to VB.net (2005). In my old application I had some macros that presented data stored in text files in Excel (Results.xls). In my upgrade I had to copy these macros to a module in a seperate Excel spread sheet (Module.xls) where I execute them. I am still learning how to program in bot .net and vb6 so your help is greatly appreciated.

The application runs well as long as I clearly specify the location of the folder containing the text files and the spread sheet used to present the data. This is the same folder that contains my executable. An example of the code I used with the location clearly specified is:

Code:
ChDir "C:\Work\Pipe02\"
Workbooks.OpenText Filename:=("COMPMASS.TXT"), Origin:= _
        xlWindows, StartRow:=1,.........
The problem I am having is that I cannot specify the location of the executable or the text files as the user may choose to install the application in whatever directory he/she may use. I tried using App.Path but that gives the directory as "". It goes without saying that my application crashes as the text files cannot be located.

The code I tried to use is:
Code:
ChDir (App.Path & "\Pipe02\")
Workbooks.OpenText Filename:=(App.Path &"\COMPMASS.TXT"), Origin:= _
        xlWindows, StartRow:=1,.........
Your help will be much appreciated in resolving this problem.