View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
[email protected] peterbrun@hotmail.com is offline
external usenet poster
 
Posts: 3
Default VBA 6.0 GetOpenFilename

Hi Chip.

Good idea. I will do that.

Peter

On 27 Feb., 20:50, "Chip Pearson" wrote:
I would recommend that you respect the user's settings and restore the
Current Directory after theGetOpenFilename

Dim OldDir As String
Dim FName As Variant
OldDir = CurDir
ChDrive "C:\Test"
ChDir "C:\Test"
FName =Aplication.GetOpenFilename(....)
ChDrive OldDir
ChDir OldDir

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLCwww.cpearson.com
(email address is on the web site)

wrote in message

ups.com...
On 27 Feb., 09:44, "NickHK" wrote:





Brun,
You can use ChDrive/ChDir before the call to .GetOpenFilenameto point to
the desired location.


NickHK


wrote in message


roups.com...


Hi all


I have a question to Excel VBA.


I am using theGetOpenFilenameapplication to open the "open file"
browser. It automatically starts browsing the last place I have saved
or downloaded a file. I am using theGetOpenFilenamein the following
way:


fileToOpen = Application.GetOpenFilename("Inflow Files (*.flo),
*.flo,All Files (*.*), *.*")


My question is:


How do I specify the path for where I wan't to browse from? Is it
Application.path??? something I have to change before I run the
GetOpenFilenamecommand?


Any help appreciated.


Regards
Brun- Skjul tekst i anførselstegn -


- Vis tekst i anførselstegn -


Off cause. Works perfect. Thankyou.

Brun- Skjul tekst i anførselstegn -

- Vis tekst i anførselstegn -