Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The fieldinfo is determinine the format of the cells and the format of the
cells in the worksheet. You are using 2 (xlTextFormat) in the fieldinfo which says to use text formating but your cells in the worksheet are set to general which is causing the zeroes to be eliminated. I would format the cells in the worksheet to text before importing the data. "LeeL" wrote: Cannot get a CVS file to open formatted as text. Using below opens columns with numbers formatted as general, losing preceding zeros. Any ideas? Workbooks.OpenText Filename:="C:\Test\INVBAL.csv", Origin:=437, _ StartRow:=1, DataType:=xlDelimited, Comma:=True, _ FieldInfo:=Array(Array(1, 2), Array(2, 2), Array(3, 2)) I tried to change the file extension to .txt, but the data is corrupted or encoded when trying to open. -- Thanks & Best Regards |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Open text file as text not numbers | Excel Programming | |||
from VBA open text file in default text editor application | Excel Programming | |||
open some txt files ,find text , copy the text before that to a single cell | Excel Programming | |||
Excel VBA - open text file, replace text, save file? | Excel Programming | |||
Workbooks.Open / .Open Text - How do you stop the .xls addition? | Excel Programming |