CSV File

C

Charles A. Lackman

Hello,

I have been able to successfully make an Excel file from data I have in a
dataset, IE:

With Excel
..SheetsInNewWorkbook = 1
..Workbooks.Add(1)
..Worksheets().Select()
For intRow = 0 To FedExDataset.Tables("Order").Rows.Count - 1
For intColumnValue = 0 To FedExDataset.Tables("Order").Columns.Count - 1
..Cells(intRow + 1, intColumnValue + 1).Value =
FedExDataset.Tables("Order").Rows(intRow).ItemArray(intColumnValue).ToString
Next
Next
strExcelFile = "C:\Customers\" & TheFileName
..ActiveWorkbook().SaveAs(strExcelFile)
..ActiveWorkbook.Close()
Exit Sub

What I am trying to do is make the file into a CSV.
".ActiveWorkbook().SaveAs(strExcelFile)" has a parameter for fileformat, but
i cannot get it to work properly. IE:

Dim TheFormat As New Excel.XlFileFormat
TheFormat = Excel.XlFileFormat.xlCSV
..ActiveWorkbook().SaveAs(strExcelFile, TheFormat)

Any Suggestions??
Thanks,
Chuck
 

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

Members online

Forum statistics

Threads
473,780
Messages
2,569,610
Members
45,255
Latest member
TopCryptoTwitterChannels

Latest Threads

Top