Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
All,
I am trying to find a way for my users to select a file that is going to be imported so that I can get the filepath. I do not want to open the file. In other words I have a Text Box that says, "Where is the file located". I want the user to be able to click a "Search" button and browse for their file just like they would with the Open Dialog Box. But instead of opening the file, I just want the filepath to replace the "Where is the file located" text. Thanks DMS |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim fName as String
fName = Application.GetOpenFileName will do exactly that. fName will hold the fully qualified name of the file the user wants to open, selected through the File=Open dialog. It does not open the file. -- Regards, Tom Ogilvy "DMS" wrote in message ... All, I am trying to find a way for my users to select a file that is going to be imported so that I can get the filepath. I do not want to open the file. In other words I have a Text Box that says, "Where is the file located". I want the user to be able to click a "Search" button and browse for their file just like they would with the Open Dialog Box. But instead of opening the file, I just want the filepath to replace the "Where is the file located" text. Thanks DMS |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That worked great.
Thanks Tom "Tom Ogilvy" wrote: Dim fName as String fName = Application.GetOpenFileName will do exactly that. fName will hold the fully qualified name of the file the user wants to open, selected through the File=Open dialog. It does not open the file. -- Regards, Tom Ogilvy "DMS" wrote in message ... All, I am trying to find a way for my users to select a file that is going to be imported so that I can get the filepath. I do not want to open the file. In other words I have a Text Box that says, "Where is the file located". I want the user to be able to click a "Search" button and browse for their file just like they would with the Open Dialog Box. But instead of opening the file, I just want the filepath to replace the "Where is the file located" text. Thanks DMS |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tom,
what if I only want the path to be remembered because i'm going to loop through multiple files in the folder? "Tom Ogilvy" wrote: Dim fName as String fName = Application.GetOpenFileName will do exactly that. fName will hold the fully qualified name of the file the user wants to open, selected through the File=Open dialog. It does not open the file. -- Regards, Tom Ogilvy "DMS" wrote in message ... All, I am trying to find a way for my users to select a file that is going to be imported so that I can get the filepath. I do not want to open the file. In other words I have a Text Box that says, "Where is the file located". I want the user to be able to click a "Search" button and browse for their file just like they would with the Open Dialog Box. But instead of opening the file, I just want the filepath to replace the "Where is the file located" text. Thanks DMS |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() fName = Application.GetOpenFileName 'get the path including the last slash Mypath = left(fName,instrrev(fName,"\")) 'get the path not including the last slash Mypath = left(fName,instrrev(fName,"\") - 1) -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=173380 Microsoft Office Help |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Open File Dialog box looks like | Excel Discussion (Misc queries) | |||
File open dialog box | Excel Discussion (Misc queries) | |||
File open dialog | Excel Discussion (Misc queries) | |||
File open with Path Name | Excel Programming | |||
Getting the full path when from a File Open Dialog Box | Excel Programming |