View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Kew[_2_] Kew[_2_] is offline
external usenet poster
 
Posts: 1
Default Runtime error 1004 with method OpenText - but only on one computer

Has anyone an idea what I should do about the following? I have som
very simple code in Ms Excel which loads a tab-delimited file into
workbook. On my PC, this works fine. On the PC of the person for who
this project is intended, it results in a runtime error 1004, "metho
OpenText of object Workbooks failed". Our versions of Excel and Window
are identical.

MS Excel 2002, Windows 2000 professional 5.0.2195 SP4

The line which gives the runtime error is as follows:
Application.Workbooks.OpenText FileName:=vK_infile(1)
FieldInfo:=Array(Array(1, xlTextFormat)), _
DataType:=xlDelimited, Tab:=True

I've tried a lot of fiddly changes including taking out all of th
papameters to OpenText which were unnecessary, adding i
"Application.Workbooks" instead of just "Workbooks", changing vK_infil
from a string to an array of one string, and putting additional arra
elements into FieldInfo to match up with the fileds 2 to 14. Nothin
made a difference.

The text file itself is pure vanilla. And invariably, doing the impor
by hand using the dialog boxes works fine, from whoseever computer.

Any ideas?

Regards - Ke

--
Message posted from http://www.ExcelForum.com