PC Review


Reply
Thread Tools Rate Thread

Getting the full path when from a File Open Dialog Box

 
 
Ric Payne
Guest
Posts: n/a
 
      8th Jul 2003
Is there an easy way to obtain the full path for a file from an File
Open Dialog Box?
Thank you in advance.
Ric Payne
 
Reply With Quote
 
 
 
 
Rob Bovey
Guest
Posts: n/a
 
      8th Jul 2003
"Ric Payne" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Is there an easy way to obtain the full path for a file from an File
> Open Dialog Box?


Hi Ric,

I'm not sure exactly what you're asking. When you use the
Application.GetOpenFilename method to prompt the user to select a file, it
returns the full path and filename of whatever file the user selects. If
this isn't what you're looking for, can you be a bit more specific?

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *


 
Reply With Quote
 
 
 
 
Rob Bovey
Guest
Posts: n/a
 
      9th Jul 2003
Hi Ric,

If the user uses the built-in File/Open dialog to open a file, the
current directory is automatically changed to the path the file was opened
from. If you want to see what that directory is, you can get the full path
and file name for any previously saved workbook using:

Workbooks("MyBook.xls").Path

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *


"Ric Payne" <(E-Mail Removed)> wrote in message
news:OhR9$(E-Mail Removed)...
> Thank you for your response Rob.
> What I want is to be able to identify the full path name when a user
> opens a file using the File Open Dialog box and browses to a different
> folder to the one that is currently being used. That will enable me to
> set the new path as the default for the file that is being worked on.
> Any help you can give me would be appreciated.
> Ric Payne
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
Ric Payne
Guest
Posts: n/a
 
      10th Jul 2003
Thank you again Rob.
Because I am only opening the file to get some data then closing it
again i wanted to capture the path so that when i subsequently saved
it i would go to the directory from which i originally got it and that
directory may not be the default directory which contains other data
files.
I figured that one way to do that was immediately after using the file
open or save dialog to cath the path as follows

NameOfPath=Left(FileName,InStrRev(FileName,"\"))

Where FileName is the name of the xls file that i opened.

That strips out the file name and leaves me with the path. Do you see
any problems with this?

"Rob Bovey" <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> Hi Ric,
>
> If the user uses the built-in File/Open dialog to open a file, the
> current directory is automatically changed to the path the file was opened
> from. If you want to see what that directory is, you can get the full path
> and file name for any previously saved workbook using:
>
> Workbooks("MyBook.xls").Path
>
> --
> Rob Bovey, MCSE, MCSD, Excel MVP
> Application Professionals
> http://www.appspro.com/
>
> * Please post all replies to this newsgroup *
> * I delete all unsolicited e-mail responses *
>
>
> "Ric Payne" <(E-Mail Removed)> wrote in message
> news:OhR9$(E-Mail Removed)...
> > Thank you for your response Rob.
> > What I want is to be able to identify the full path name when a user
> > opens a file using the File Open Dialog box and browses to a different
> > folder to the one that is currently being used. That will enable me to
> > set the new path as the default for the file that is being worked on.
> > Any help you can give me would be appreciated.
> > Ric Payne
> >
> >
> >
> > *** Sent via Developersdex http://www.developersdex.com ***
> > Don't just participate in USENET...get rewarded for it!

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open file from path in cell and open from current file path abc987 Microsoft Excel Programming 0 4th May 2011 02:44 PM
Open Dialog Box to return Selected File Path and Not Open it. =?Utf-8?B?RE1T?= Microsoft Excel Programming 3 26th Jan 2010 05:38 AM
Getting File Path in Browse File Dialog in ASP.Net =?Utf-8?B?ZGVuIDIwMDU=?= Microsoft ASP .NET 3 8th May 2006 09:33 AM
How to write path and file name to file open dialog box that is not created by VB? John Clark Microsoft VB .NET 0 19th Jan 2005 12:24 PM
Getting file size from full file path and reading ID3 tags?? supster Microsoft C# .NET 4 6th Jun 2004 02:42 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:22 PM.