带有excel导出功能的程序,在客户机安装时出现的问题
开发的环境是xp+office2003,用vs05自带的安装打包做了个安装程序,“系统必备”里加上了水晶报表、“从应用程序位置下载系统必备组件”。复制过去的有程序集:Microsoft.Office.Interop.Excel.dll、Microsoft.Vbe.Interop.dll、office.dll。
在客户机上安装后,excel导入功能可以用,但导出功能出错,说什么Excel.Range.set_Value不支持集合,具体提示:
************** 异常文本 **************
System.Runtime.InteropServices.COMException (0x80020011): 不支持集合。 (异常来自 HRESULT:0x80020011 (DISP_E_NOTACOLLECTION))
在 System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
在 Microsoft.Office.Interop.Excel.Range.set_Value(Object RangeValueDataType, Object )
在 myprj.ExcelUtil.DB2Excel(DataSet dataSet, String filename, Int32 sheetid)
在 myprj.GuideExportForm.button2_Click(Object sender, EventArgs e)
在 System.Windows.Forms.Control.OnClick(EventArgs e)
在 System.Windows.Forms.Button.OnClick(EventArgs e)
在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.ButtonBase.WndProc(Message& m)
在 System.Windows.Forms.Button.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)