Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open Dialog..! in vb code..!
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open Dialog..! in vb code..!
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open Dialog..! in vb code..!
Thanx Jim, did the trick exactly.
"Jim Thomlinson" wrote in message ... | 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 | | | |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Open Dialog Box to return Selected File Path and Not Open it. | Excel Programming | |||
VBA code to open 3D dialog window | Excel Programming | |||
Code for bring up the file-open dialog box | Excel Programming | |||
Open file with open dialog box | Excel Programming | |||
control of dialog macro dialog box. on open | Excel Programming |