Error al Generar archivo de Excel

25/09/2006 - 19:50 por J o h N u S \(PE\) | Informe spam
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

#1 J o h N u S \(PE\)
26/09/2006 - 15:21 | Informe spam
Ya solucione el error.



"J o h N u S (PE)" wrote in message
news:
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.



Preguntas similares