Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
DataSet to Excel/text
Hi,
Please could someone help me do the following in VB .NET. I would like to know the most efficient way to write a populated dataset to a csv or text file, naming and labelling the file and sheet. Is one able to use dataset.writeXML(path). I can get this to work but I would like it in normal excel format rather then xml code. Any examples would be much appreciated. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
DataSet to Excel/text
Activeworkbook.SaveAs Filename:="ABCD.csv", FileFormat:=xlCSV
would be the way to write it in VBA. Assume it would be similar in .NET. -- Regards, Tom Ogilvy "11Oppidan" wrote in message ... Hi, Please could someone help me do the following in VB .NET. I would like to know the most efficient way to write a populated dataset to a csv or text file, naming and labelling the file and sheet. Is one able to use dataset.writeXML(path). I can get this to work but I would like it in normal excel format rather then xml code. Any examples would be much appreciated. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
DataSet to Excel/text
"most efficient way" is a loaded phrase, and you wouldn't write an
entire dataset to a csv file, you'd have to just write a DataTable's worth. You also wouldn't be able to specify sheet name, because that's specific to xls and not csv. Csv can basically only hold one flat tables worth of data. I do have a component that will handle this for you, which I'm sorry to say is not free, if that's a requirement. It is however only one line other than creating the component and disposing the component. I also have a benchmarks page that compares "efficiency" of my component vs the jet driver and the microsoft text driver. The method to look for is CsvWriter.WriteAll. It's in the help docs, and used in the Tab Delimited to CSV sample. There's also a demo version available for download to see how it works. http://www.geocities.com/shriop/index.html is the main page. There's a samples link, benchmarks link, help docs link, and demo version link all off of that page. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
DataSet to Excel/text
Hi
You also take a look at the link below. HOW TO: Transfer Data to an Excel Workbook by Using Visual Basic .NET http://support.microsoft.com/?id=306022 Best regards, Peter Huang Microsoft Online Partner Support Get Secure! - www.microsoft.com/security This posting is provided "AS IS" with no warranties, and confers no rights. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel dataset size | Excel Discussion (Misc queries) | |||
How do I customize the X-axis in excel to match my dataset? | Charts and Charting in Excel | |||
Create Excel Document from a Dataset using VB.Net | Excel Programming | |||
Want to Bind ADO Dataset to Excel 2003 Pivottable | Excel Programming | |||
Passing a dataset from jsp to browser excel plugin | Excel Programming |