Write to a CSV file

A

alvin Kuiper

Hi!!
I use this:
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile("test.csv", 8)
f.Writeline Report_lageroversigt.nr.value & ";" &
Report_lageroversigt.Navn.value & ";" &
Report_lageroversigt.Sum_Of_antal.value
f.Close

Its work fine in a text file, but when i write to a csv file and open this
file en excel
then the first row (1) is empty
why?
 
D

Douglas J. Steele

What exactly do you mean by "work fine in a text file"? Are you saying that
when you open the file in Notepad, there's no blank line at the top?

There's nothing intrinsic to the code that should cause a blank line, but
remember that the 8 in the call to the OpenTextFile method means you're
appending to an existing file. Perhaps there's a blank line already in the
file.
 

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