VB.net and Excel's Default Save Location

phantom404

Golden Member
Nov 2, 2004
1,460
2
81
I'm currently opening and xml document and converting it to and excel file. I have everything working perfectly except when I go to save the excel file its automatically saving to excel's default location which is My Documents. Anybody have any clue on how to save it to the current directory I'm running the program from.

This is a command line program which i have stored in c:\pgms. I have c:\pgms stored in the environmental variables so I can run them from any directory. Using vb.net 2008.

Thanks
 

Snapster

Diamond Member
Oct 14, 2001
3,916
0
0
You can use Application.StartupPath() or Application.ExecutablePath()
to get the path of the running .Net application, and from there you should be able modify it to a path of your choosing.