Exporting from access to excel with .net (c#)
Hi
The problem is that I have big files (50k lines +) from merging different excel sheets (through c# and little manipulation in datagrids) and I want to export them in excel again.
All methods I've tried are really slow for this size of files (in my pc is about 1 1/2 min for a 1000 lines. I havent tested yet the spire, but anyway I don't want to do it this way.
Up to now I saved the datatable as xml and then import it in access and export it in xls. This procedure is very fast in contrast to importing from xml directly in excel (which is actually the same slow as doing it with COM cell2cell through c#)
Is there anyway to use this ms-access export to Excel procedure through access.interop?
Thanks.
Re: Exporting from access to excel with .net (c#)
In case someone needs it this is it:
Code:
oAccess.DoCmd.TransferSpreadsheet(Microsoft.Office.Interop.Access.AcDataTransferType.acExport,
Microsoft.Office.Interop.Access.AcSpreadSheetType.acSpreadsheetTypeExcel12Xml,
"TableName", @"pathToSave", bHasFieldNames);