J
Jorge Cavalheiro
Hello
After reading yesterday's thread on performance of C# and
vb.net i've just turn it on my solution and spent 2 hours
correcting the errors
I have a problem i don't how to fix i have a class that
export data to a Excel Workbook.
I get 2 types of errors : Option Strict On disallows
implicit conversions from 'System.Object'
to 'Excel.Worksheet' and Option Strict On disallows late
binding.
This how the excel objects are defined :
Dim objPrograma As New Excel.Application
Dim objLivro As Excel.Workbook = objPrograma.Workbooks.Add
Dim objFolha As Excel.Worksheet = objPrograma.ActiveSheet
The following raise errors:
objLivro.Sheets("Folha1").name = "Português"
objLivro.Sheets("Folha2").delete()
And also:
objLivro.Sheets("English").activate()
objFolha = objPrograma.ActiveSheet()
For example the following works ok:
objFolha.Range("a4").VerticalAlignment =
Excel.XlHAlign.xlHAlignCenter
objFolha.Range("a4").HorizontalAlignment =
Excel.XlHAlign.xlHAlignCenter
Any suggestion how to solve this matter, would be most
welcome thanks!
Kind Regards
Jorge Cavalheiro
After reading yesterday's thread on performance of C# and
vb.net i've just turn it on my solution and spent 2 hours
correcting the errors
I have a problem i don't how to fix i have a class that
export data to a Excel Workbook.
I get 2 types of errors : Option Strict On disallows
implicit conversions from 'System.Object'
to 'Excel.Worksheet' and Option Strict On disallows late
binding.
This how the excel objects are defined :
Dim objPrograma As New Excel.Application
Dim objLivro As Excel.Workbook = objPrograma.Workbooks.Add
Dim objFolha As Excel.Worksheet = objPrograma.ActiveSheet
The following raise errors:
objLivro.Sheets("Folha1").name = "Português"
objLivro.Sheets("Folha2").delete()
And also:
objLivro.Sheets("English").activate()
objFolha = objPrograma.ActiveSheet()
For example the following works ok:
objFolha.Range("a4").VerticalAlignment =
Excel.XlHAlign.xlHAlignCenter
objFolha.Range("a4").HorizontalAlignment =
Excel.XlHAlign.xlHAlignCenter
Any suggestion how to solve this matter, would be most
welcome thanks!
Kind Regards
Jorge Cavalheiro