![]() |
GetOpenFileName
Hi, Is there a way to select the folder path as opposed to the file path using this method. directory = Application.GetOpenFilename("Excel Files (*.xls), *.xls") I want to use the save as window, similar to selecting the file path with the above line. Things is I want the folder/directory path. Any ideas would be greatly appreciated. Cheers, Tom -- Tomski ------------------------------------------------------------------------ Tomski's Profile: http://www.excelforum.com/member.php...o&userid=26824 View this thread: http://www.excelforum.com/showthread...hreadid=472937 |
GetOpenFileName
Hi
See the second example on this page http://www.rondebruin.nl/windowsxpzip.htm You can use the code from that macro -- Regards Ron de Bruin http://www.rondebruin.nl "Tomski" wrote in message ... Hi, Is there a way to select the folder path as opposed to the file path using this method. directory = Application.GetOpenFilename("Excel Files (*.xls), *.xls") I want to use the save as window, similar to selecting the file path with the above line. Things is I want the folder/directory path. Any ideas would be greatly appreciated. Cheers, Tom -- Tomski ------------------------------------------------------------------------ Tomski's Profile: http://www.excelforum.com/member.php...o&userid=26824 View this thread: http://www.excelforum.com/showthread...hreadid=472937 |
GetOpenFileName
Tom,
This gives you the folder for the file selected in GetOpenFileName... '------------------------------- Sub FolderFromFilePath() Dim strLocation As Variant Dim N As Long strLocation = Application.GetOpenFilename("Excel Files (*.xls), *.xls") If strLocation = False Then Exit Sub For N = Len(strLocation) To 1 Step -1 If Mid$(strLocation, N, 1) = "\" Then Exit For Next strLocation = Left$(strLocation, N - 1) MsgBox strLocation End Sub '------------------------- Jim Cone San Francisco, USA "Tomski" wrote in message ... Hi, Is there a way to select the folder path as opposed to the file path using this method. directory = Application.GetOpenFilename("Excel Files (*.xls), *.xls") I want to use the save as window, similar to selecting the file path with the above line. Things is I want the folder/directory path. Any ideas would be greatly appreciated. Cheers, Tom |
GetOpenFileName
Nice one guys, thanks for that. -- Tomsk ----------------------------------------------------------------------- Tomski's Profile: http://www.excelforum.com/member.php...fo&userid=2682 View this thread: http://www.excelforum.com/showthread.php?threadid=47293 |
All times are GMT +1. The time now is 05:06 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com