LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Reading CSV file from Excel (VBA)

Hi to all,

dont know if somebody can help me.
I have an excel sheet that is saved from xls to csv.

the sheet as this format :
MSC1 MSCA
MSC2 MSCB
MSC3 MSCC
MSC4 MSCD

each value in a column

When reading the file with the below code, it's seems
that it is skipping a line for each line it reads
ex : would read MSC2 then MSC4 and (with excel 2003 it
would be MSC1 then MSC4...)

Dim arrFileLines()
i = 0

Set objFSO = CreateObject("Scripting.FileSystemObject")
'Name of file saved from excel xls -- CSV
'To be outputed to another file name....
Set objFile = objFSO.OpenTextFile("C:\Temp\TempCN.csv", 1)

Do Until objFile.AtEndOfStream
Redim Preserve arrFileLines(i)
arrFileLines(i) = objFile.ReadLine
i = i + 1
Loop

objFile.Close

For l = Ubound(arrFileLines) to LBound(arrFileLines) Step
1
' writting line to file
Next

Did anybody come in contact with the same problem and how
did you fix it or is there a better way to do this?

Thank you in advance.

Alex
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA macro for reading text file into Excel Javed Khan Excel Discussion (Misc queries) 0 October 14th 09 06:29 PM
While reading excel file i am getting null values Aruna Tennakoon Excel Programming 0 April 23rd 04 04:04 AM
While reading excel file i am getting null values Aruna Tennakoon Excel Programming 1 April 22nd 04 12:57 PM
Reading an excel file in SPSS Gary Excel Programming 4 April 17th 04 04:03 PM
Reading an Excel file after upload Quan[_2_] Excel Programming 0 November 6th 03 12:12 AM


All times are GMT +1. The time now is 11:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"