opentext method of excel workbook object

K

Kislay

I am using the following code in word macro and it gives error that opentext
method failed.

Set MinMax = CreateObject("Excel.Application")
MinMax.workbooks.Opentext FileName:="d:\abc.txt", _
Origin:=xlMSDOS, StartRow:=17, DataType:=xlDelimited,
TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=True,
Semicolon:=False, _
Comma:=False, Space:=True, Other:=False, FieldInfo:=Array(Array(1,
1), _
Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1))

Any help is appreciated.

Thanks.
 
T

Tom Ogilvy

Since you appear to be using late binding,
Replace the constants with their numeric equivalents:

? xldelimited
1
? xldoublequote
1
 
K

Kislay

Thanks Tom,

It works fine now.

Kislay

Tom Ogilvy said:
Since you appear to be using late binding,
Replace the constants with their numeric equivalents:

? xldelimited
1
? xldoublequote
1
 

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