I have DataTable I should be put in Excel 2007 format and it's an Excel file Must save as (.xlsx) 2007.
Can anyone help me achieve this?
You can use an OLEDB data provider and just enter your datasetable rows For loop and ado through Net data sources can be treated as. Here is a Microsoft KB article that walks you through a lot of details.
Keep in mind that you can create workbooks and sheets within the workbook, and you can reference the existing sheet by adding a '$' at the end of the name If you leave '$' at the end of the letter name, then the OLDB provider will assume that it is a new sheet and will try to make it.
The dollar sign worksheet according to the name is an indication that the table exists if you are creating a new table, as discussed in the new Workbook and Tables section of this article, Do not use the dollar sign. You can create and spreadsheet (.xls) or 2007 format (xlsx) in 2003, and it is defined on your connection string - you specify the file you want to write. , And specify the extension Make sure that you use the correct OLEDB provider version.
If you want to create a 2003 (.xls) version, you can use this connection string:
Provider = Microsoft.Jet.OLEDB.4.0 ; Data source = C: \ Book1.xls; Expanded Properties = "Excel 8.0; HDR = YesIf you want to create a 2007 (.xlsx) version, you can use this connection string:
< Pre>Provider = Microsoft.ACE.OLEDB.12.0; Data Source = C: \ Book1.xlsx; Extended Properties = "Excel 12.0; HDR = YesYou can find it to download Ace Provider from Microsoft to create XLSX files.
I usually use an XLS provider, so I have not done much work with the XLSX provider.
Hope it helps me tell me that you have other questions.
Comments
Post a Comment