J
James Wong
Dear all,
I have an old VB6 application which can create and access Excel object. The
basic definition statements are as follows:
Dim appExcel As Object
Dim wkb1 As Excel.Workbook
Dim wks1 As Excel.Worksheet
Set appExcel = New [_ExcelApplication]
Set wkb1 = appExcel.Workbooks.Open(strFileName)
Set wks1 = wkbSalesSumy.Worksheets("One")
However, in VB.NET 2003, I got problem to do the same thing:
Dim appExcel As Excel.Application
Dim wkb1 As Excel.Workbook
Dim wks1 As Excel.Worksheet
appExcel = New Excel.Application ' since Excel.Application is
interface, this statement will fail due to "New" is not applicable to
interface
Besides, how can I create new worksheet using VB code?
Thanks for your attention and kindly help!
Regards,
James Wong
I have an old VB6 application which can create and access Excel object. The
basic definition statements are as follows:
Dim appExcel As Object
Dim wkb1 As Excel.Workbook
Dim wks1 As Excel.Worksheet
Set appExcel = New [_ExcelApplication]
Set wkb1 = appExcel.Workbooks.Open(strFileName)
Set wks1 = wkbSalesSumy.Worksheets("One")
However, in VB.NET 2003, I got problem to do the same thing:
Dim appExcel As Excel.Application
Dim wkb1 As Excel.Workbook
Dim wks1 As Excel.Worksheet
appExcel = New Excel.Application ' since Excel.Application is
interface, this statement will fail due to "New" is not applicable to
interface
Besides, how can I create new worksheet using VB code?
Thanks for your attention and kindly help!
Regards,
James Wong