Ver Mensaje Individual
  #2 (permalink)  
Antiguo 05/12/2014, 13:22
Avatar de Drako_18
Drako_18
 
Fecha de Ingreso: mayo-2005
Ubicación: Madrid
Mensajes: 505
Antigüedad: 19 años
Puntos: 16
Respuesta: Fallo al trabajar con Excel

Buenas compañero,

Pues según he leído por ahí, con este ejemplo debería funcionar:
Código vb.net:
Ver original
  1. ' Create new ExcelFile.
  2. Dim workbook2 = New ExcelFile()
  3.  
  4. ' Imports all tables from DataSet to new file.
  5. For Each dataTable As DataTable In dataSet.Tables
  6.     ' Add new worksheet to the file.
  7.     Dim worksheet = workbook2.Worksheets.Add(dataTable.TableName)
  8.  
  9.     ' Change the value of the first cell in the DataTable.
  10.     dataTable.Rows(0)(0) = "This is new file!"
  11.  
  12.     ' Insert the data from DataTable to the worksheet starting at cell "A1".
  13.     worksheet.InsertDataTable(dataTable,
  14.         New InsertDataTableOptions("A1") With {.ColumnHeaders = True})
  15. Next
  16.  
  17. ' Save the file to XLS format.
  18. workbook2.Save("DataSet.xls")


Espero que te sea de utilidad.. Sino... Pon tu código para analizarlo..
Un saludo!
__________________
Rubén Espada
Desarrollador full stack .Net (Angular + JS + .Net Core)