Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OpenText command works on one machine and not another

Status
Not open for further replies.

DanAuber

IS-IT--Management
Apr 28, 2000
255
FR
I have (an inherited !) VB script with the Workbooks.OpenText command in it. On one machine it opens the file nicely and puts the data into the columns correctly, on another all the data just goes into one column. I'm guessing this is either due to a Global PC or Excel setting - can anyone shed any light on where I might compare the two PCs.

Line of code is here:

Workbooks.OpenText FileName:=INFWorkBookToOpen, Origin:= _
xlMSDOS, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 1) _
, Array(23, 1), Array(38, 1), Array(50, 1), Array(63, 1), Array(74, 1), Array(90, 1), Array( _
100, 1), Array(123, 1), Array(148, 1), Array(172, 2), Array(194, 2), Array( _
211, 1), Array(250, 1), Array(260, 1), Array(273, 1), Array(290, 1), Array(314, 1), Array( _
326, 1)), TrailingMinusNumbers:=True

 



Same OS and version of Office?

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
Different Regional settings? Different delimiter? Can get complicated if you have "," set as the decimal character and are trying to load a .csv file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top