Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to save the complete path of the file we open?
Use a variable declared at the top of the code. Put it in a module if you
need global access. Dim FilePath as string Then, assuming you are using .GetFileOpenName or something similar: Dim FileName As String FileName = Application.GetOpenFilename() FilePath=Left(FileName, InStrRev(FileName, "\")) Adjust and add error trapping, depending on your method of file selection/multi-select etc. NickHK "GeneWan" wrote in message ... eg. my code prompted user to choose the file(s) to be opened within the same path. How can I save the path so that I could use it later on? purpose is so that I can create a file in the same path afterwards.. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to save the complete path of the file we open?
thanks nick, works just right! :)
"NickHK" wrote: Use a variable declared at the top of the code. Put it in a module if you need global access. Dim FilePath as string Then, assuming you are using .GetFileOpenName or something similar: Dim FileName As String FileName = Application.GetOpenFilename() FilePath=Left(FileName, InStrRev(FileName, "\")) Adjust and add error trapping, depending on your method of file selection/multi-select etc. NickHK "GeneWan" wrote in message ... eg. my code prompted user to choose the file(s) to be opened within the same path. How can I save the path so that I could use it later on? purpose is so that I can create a file in the same path afterwards.. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Open Dialog Box to return Selected File Path and Not Open it. | Excel Programming | |||
Want to Set the File Save As path | Excel Programming | |||
Save to Path & Variable file name | Excel Programming | |||
How set file open path to filepath of file opened with Explorer ? | Excel Programming | |||
get path - save new file - same sub-directory as existing file | Excel Programming |