windows窗体应用程序,操作Excel,"无法创建ActiveX组件" 求指点啊指点
- VB.NET code
Dim excelApp As Microsoft.Office.Interop.Excel.Application Dim excelWorkbook As Microsoft.Office.Interop.Excel.Workbook '= NothingDim excelSheet As Microsoft.Office.Interop.Excel.Worksheet '= Nothing'excelApp = CType(CreateObject("Microsoft.Application"), Microsoft.Office.Interop.Excel.Application)excelApp = CreateObject("Microsoft.Office.Interop.Excel.Application")excelApp.Visible = TrueexcelWorkbook = excelApp.Workbooks.Open(OpenFileDialog1.FileName)excelApp.Workbooks.Add(True) excelSheet = excelWorkbook.Worksheets("sheet1")在CreateObject时出现问题,"无法创建ActiveX组件".MSDN上说是控件没注册,我该怎么查看注没注册?但我的组件服务里有"Microsoft Excel Application".
或者..该怎么解决?
求指点
[解决办法]
把Interop.Excel.dll复制到bin目录下
添加引用“浏览”选中Interop.Excel.dll就表示可以使用这个组件了