Mah*_*der 6 c# excel interop exception
在我的C#程序中,我正在使用Excel 2010互操作程序集.有了这个,我正在读取和写入excel文件的数据.并在开发框上执行正常(包含Office 2010).在客户端计算机上,即使它们具有Office 2010和Office PIA,也会看到下面的异常,在WriteToExcel()方法调用时引发.
Unhandled Exception: System.MissingMethodException: Method not found: 'System.Type System.Runtime.InteropServices.Marshal.GetTypeFromCLSID(System.GUID)'.
Run Code Online (Sandbox Code Playgroud)
以下是我的代码段.
[STAThread]
static void Main(string[] args){
// read user input, process and write data to Excel
WriteToExcel();
}
[STAThread]
static void WriteToExcel(){
Application xlsApplication = new Application();
Workbook xlsWorkbook = xlsApplication.Workbooks.Open(excelFilePath);
// write data to excel
// close up
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5367 次 |
| 最近记录: |