Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
avi avi is offline
external usenet poster
 
Posts: 195
Default Selecting a file from dialog

Hello,

Most of the exemple show how to launch from VBA a dialog to open a file from a directory.

Is there a dialog that is used to select the file so i can use its path name in the module, without opening the file?

Regards

Avi
www.avibenita.com
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Selecting a file from dialog

Avi,

The following code will display the File Open dialog and return
the selected file name. It doesn't open the file.

Dim FName As Variant
FName = Application.GetOpenFilename()
If FName = False Then
' no file selected
Else
MsgBox "You chose: " & FName
End If

For other methods of selecting just a folder (not a file), see
http://www.cpearson.com/excel/BrowseFolder.htm


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Avi" wrote in message
...
Hello,

Most of the exemple show how to launch from VBA a dialog to open
a file from a directory.

Is there a dialog that is used to select the file so i can use
its path name in the module, without opening the file?

Regards

Avi
www.avibenita.com


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
Selecting Cells using dialog box Todd Huttenstine Excel Programming 3 December 16th 04 05:12 PM
Selecting a file path in Excel VBA using FileOpen dialog John Robinson Excel Programming 1 November 1st 03 09:59 AM
Prompt user to select file with default file selected dialog Bruce Cooley Excel Programming 0 September 15th 03 06:43 AM
Prompt user to select file with default file selected dialog Bob Phillips[_5_] Excel Programming 0 September 14th 03 09:22 PM
Prompt user to select file with default file selected dialog Bob Phillips[_5_] Excel Programming 0 September 14th 03 09:19 PM


All times are GMT +1. The time now is 02:53 AM.

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"