View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Open Dialog..! in vb code..!

Sorry I should have elaborated on why I chose to use GetOpenfilename. You can
use

Application.Dialogs(xlDialogOpen).Show "*.csv"

But that opens the file. It does not return the name to a variable. I assume
you did not intend to open the CSV.
--
HTH...

Jim Thomlinson


"Jim Thomlinson" wrote:

Try this...

Dim strFileName As String

strFileName = Application.GetOpenFilename("Text Files (*.csv), *.csv")

--
HTH...

Jim Thomlinson


"Andrew" wrote:

I want to read a CSV file(using Open/Read etc), and parse the file in
code to set certain cell values...

1) How can i use an xlOpenDialog dialog box to allow the user to
select a CSV file
2) Return the name of the selected file into a variable.


I don't want to have to build a userform, and if possible use the
Application.Dialogs(xlOpenDialog) function.
I'm sure ive used this method before, but am unable to find it in my
archives.

Any Feedback is always appreciated.
Thankyou for your time.

Andrew