©
©pEIO
Example:
Dim xlsExcel As Excel.Application
Dim wkbExcel As Excel.Workbook
Dim wksExcel As Excel.Worksheet
xlsExcel = New Excel.Application
wkbExcel = xlsExcel.Workbooks.Open("C:\Test.xls")
wksExcel = wkbExcel.Worksheets(i)
In this point I have an error of conversion because Option Strict On can't
convert
System.Object in Microsoft.Office.Interop.Excel.Worksheet.
It's very strange because before that I install the PIA for Office 2003, the
object
wkbExcel.Worksheets(i) was an Microsoft.Office.Interop.Excel.Worksheet
object.
But I have resolved with this:
wksExcel = CType(wkbExcel.Worksheets(i), Excel.Worksheet)
MessageBox.Show(CType(wksExcel.Cells(6, 1), String))
In the last istruction an exception occurred. The message like this "Cast
not possible
from Range type to String type".
I have try with the MSDN example but the same exception occurred.
Somebody have some idea?? I'm crazy...
Thanks. Ciao.
pEIO
Dim xlsExcel As Excel.Application
Dim wkbExcel As Excel.Workbook
Dim wksExcel As Excel.Worksheet
xlsExcel = New Excel.Application
wkbExcel = xlsExcel.Workbooks.Open("C:\Test.xls")
wksExcel = wkbExcel.Worksheets(i)
In this point I have an error of conversion because Option Strict On can't
convert
System.Object in Microsoft.Office.Interop.Excel.Worksheet.
It's very strange because before that I install the PIA for Office 2003, the
object
wkbExcel.Worksheets(i) was an Microsoft.Office.Interop.Excel.Worksheet
object.
But I have resolved with this:
wksExcel = CType(wkbExcel.Worksheets(i), Excel.Worksheet)
MessageBox.Show(CType(wksExcel.Cells(6, 1), String))
In the last istruction an exception occurred. The message like this "Cast
not possible
from Range type to String type".
I have try with the MSDN example but the same exception occurred.
Somebody have some idea?? I'm crazy...
Thanks. Ciao.
pEIO