Import Data, using a command line switch

  • Thread starter § Balisteor.
  • Start date
Â

§ Balisteor.

Hello all.

I would like to know if it is possible to open a comma delimited text file
without going through the import data wizard.
I want to be able to use a command line switch or if there are default
import settings that I can set so that when i have Excel open the text file
it will import it correctly without any user input.

Thank you for you reading :D
 
P

Patrick Molloy

try this

Sub OpenAFile()

Dim fname As String

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

Workbooks.Open fname

End Sub

at least on my pc, Vista and excel 2003, it just opens without any wizardry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top