Open Excel File Delimited with VBA Code

landar

Registered User.
Local time
Today, 01:39
Joined
Feb 6, 2003
Messages
14
I am trying to open an excel file as a delimited file using VBA code (so I can perform some automated manipulations on the file from Access before importing the data into a table).

The issue I am having is with using the file open parameters (with the exception of Origin, which Access VBA accepts).

The ones in particular I need to use are DataType:=1 (xlDelimited) and Comma:=True.

The error I receive is "Named Argument Not Found."

The code I am using is as follows:

Dim xl As Object

Set xl = CreateObject("Excel.Application")

With xl
.Visible = True
.UserControl = True
.workbooks.Open "<insert file path and name here>", Origin:=2, StartRow:=1, DataType:=1, TextQualifier:=-4142, ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), Array(2, 1))


If I just open the file normally, it does not open comma delimited, but instead is all inserted into column A.

I am using Access and Excel 2000.

Any help with this would be greatly appreciated.

Thanks, :)

~Seth Neustein
 

Users who are viewing this thread

Back
Top Bottom