Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
DMS DMS is offline
external usenet poster
 
Posts: 9
Default Open Dialog Box to return Selected File Path and Not Open it.

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Open Dialog Box to return Selected File Path and Not Open it.

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   Report Post  
Posted to microsoft.public.excel.programming
DMS DMS is offline
external usenet poster
 
Posts: 9
Default Open Dialog Box to return Selected File Path and Not Open it.

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Open Dialog Box to return Selected File Path and Not Open it.

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Open Dialog Box to return Selected File Path and Not Open it.


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open File Dialog box looks like Steven Excel Discussion (Misc queries) 3 January 30th 10 07:44 PM
File open dialog box [email protected] Excel Discussion (Misc queries) 1 March 21st 07 03:01 AM
File open dialog Vaughan Excel Discussion (Misc queries) 0 May 12th 05 08:50 AM
File open with Path Name rickey24[_8_] Excel Programming 4 July 8th 04 01:04 AM
Getting the full path when from a File Open Dialog Box Ric Payne Excel Programming 3 July 10th 03 04:58 PM


All times are GMT +1. The time now is 06:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"