Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default VBA 6.0 GetOpenFilename

Hi all

I have a question to Excel VBA.

I am using the GetOpenFilename application to open the "open file"
browser. It automatically starts browsing the last place I have saved
or downloaded a file. I am using the GetOpenFilename in 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
GetOpenFilename command?

Any help appreciated.

Regards
Brun

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default VBA 6.0 GetOpenFilename

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

NickHK

wrote in message
oups.com...
Hi all

I have a question to Excel VBA.

I am using the GetOpenFilename application to open the "open file"
browser. It automatically starts browsing the last place I have saved
or downloaded a file. I am using the GetOpenFilename in 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
GetOpenFilename command?

Any help appreciated.

Regards
Brun



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default VBA 6.0 GetOpenFilename

On 27 Feb., 09:44, "NickHK" wrote:
Brun,
You can use ChDrive/ChDir before the call to .GetOpenFilename to point to
the desired location.

NickHK

wrote in message

oups.com...



Hi all


I have a question to Excel VBA.


I am using the GetOpenFilename application to open the "open file"
browser. It automatically starts browsing the last place I have saved
or downloaded a file. I am using the GetOpenFilename in 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
GetOpenFilename command?


Any help appreciated.


Regards
Brun- Skjul tekst i anførselstegn -


- Vis tekst i anførselstegn -


Off cause. Works perfect. Thankyou.

Brun

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default VBA 6.0 GetOpenFilename

I would recommend that you respect the user's settings and restore the
Current Directory after the GetOpenFilename

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, LLC
www.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 .GetOpenFilename to point to
the desired location.

NickHK

wrote in message

oups.com...



Hi all


I have a question to Excel VBA.


I am using the GetOpenFilename application to open the "open file"
browser. It automatically starts browsing the last place I have saved
or downloaded a file. I am using the GetOpenFilename in 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
GetOpenFilename command?


Any help appreciated.


Regards
Brun- Skjul tekst i anførselstegn -


- Vis tekst i anførselstegn -


Off cause. Works perfect. Thankyou.

Brun


  #5   Report Post  
Posted to microsoft.public.excel.programming
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 -



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
Using GetOpenFilename Chaplain Doug Excel Programming 3 February 6th 07 09:01 PM
GetOpenFileName help Leith Ross[_12_] Excel Programming 0 April 8th 05 10:14 PM
GetOpenFilename Roman Excel Programming 5 February 8th 05 10:20 PM
GetOpenFilename wtpcomplab Excel Programming 4 January 4th 05 06:36 PM
getopenfilename inquirer Excel Programming 1 December 3rd 03 11:37 AM


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

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

About Us

"It's about Microsoft Excel"