|
-
Mar 15th, 2004, 04:25 AM
#1
Thread Starter
New Member
Multiple sheets using CSV
Hi,
I am using the following code in VB6 to generate a CSV file that opens in MS EXCEL :
CODE :
Dim printLINE as String
Dim ctr as Integer
Open "c:\File1.CSV" For Output As #1
For ctr = 0 To 20
printLINE = printLINE & ctr & ","
next ctr
Print #1, printLINE
This generates a csv file by the name File1.csv with only one sheet by the name File1.
My question is that how can i have more that one sheet e.g. File1 & File2 within the same csv file File1.CSV?
Does any body have any idea ?
Arun
-
Mar 15th, 2004, 07:04 AM
#2
Addicted Member
csv files only support single sheets, so would think you would need to have seperate files for each.
Code:
Dim printLINE as String
Dim ctr as Integer
Dim intFileCtr as integer
for intFileCtr = 1 to MaxFileNumber
Open "c:\File" & intFileCtr & ".CSV" For Output As #intFileCtr
For ctr = 0 To 20
printLINE = printLINE & ctr & ","
next ctr
Print #intFileCtr , printLINE
next intFileCtr
seems to work ok.
HTH
Brian
if you fail to plan, you plan to fail
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|