TextImportWizard & VBA

T

Tom

Hi

I'd like to open a text file with a vba script. Is it possible to open the
file using the TextImportWizard?

Tom
 
S

steve

Tom,

Works like a champ.

And you can record your actions to create the vba.

Post back if you have problems. Include the type of text - how it is
delimited, etc...

I have code that opens the Open dialog to help me select one or more files.
It than opens each and converts each to an Excel file. My files are tab
delimited.

You can even include formatting and 'other stuff'...
 
T

Tom

I use the following code:

Workbooks.OpenText FileName:=strFile

This code automatically opens the textfile, but what is if the textfile
contains different text deliminators? In this case the file should be opened
with the TextImportWizard.

Tom
 
S

steve

Tom,

I agree. Your code left all the """" and "," in my open.
Need to go back to the code you gave me a long time ago to open
with the GetOpenFilename followed with a wizard code.

Darn! Thought I could shorten my code...
 
Top