hola amigos e estado intentando de generar un archivo de excel, desde la
ayuda de microsoft del MSDN pero me arroja un error, les pego el codigo que
estoy utilizando a ver si me pueden dar una mano.
Imports Microsoft.Office.Interop.Excel
Dim xlApp As Microsoft.Office.Interop.Excel.Application
Dim xlBook As Microsoft.Office.Interop.Excel.Workbook
Dim xlSheet As Microsoft.Office.Interop.Excel.Worksheet
xlApp = CType(CreateObject("Excel.Application"),
Microsoft.Office.Interop.Excel.Application)
xlBook = CType(xlApp.Workbooks.Add, Microsoft.Office.Interop.Excel.Workbook)
xlSheet = CType(xlBook.Worksheets(1),
Microsoft.Office.Interop.Excel.Worksheet)
' The following statement puts text in the second row of the sheet.
xlSheet.Cells(2, 2) = "This is column B row 2"
' The following statement shows the sheet.
xlSheet.Application.Visible = True
' The following statement saves the sheet to the C:\Test.xls directory.
xlSheet.SaveAs("C:\Test.xls")
' Optionally, you can call xlApp.Quit to close the workbook.
y Cuando genero el archivo del Excel me muestra los siguiente smensjaes
When Deploying an office solution, check to make syre you have fulfilled all
nacessary security requriments.
use a certificate to obtain the required persmissions
if an assembly implmenting the custom security object references other
assemblies, add the referenced assemblies
to the full trust assembly list.
Leer las respuestas