System.Runtime.InteropServices.COMException(0x800706BE) [英] System.Runtime.InteropServices.COMException (0x800706BE)

查看:155
本文介绍了System.Runtime.InteropServices.COMException(0x800706BE)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用C#并打印一个excel文件时,我得到了异常。你能告诉我一个原因吗?

2009-03-19 13:16:26 [1]错误系统.Runtime.InteropServices.COMException(0x800706BE):リモートプロシージャコールに失败しました。(场所からの例外:0x800706BE)
场所Microsoft.Office.Interop.Excel.Workbooks.Open(String Filename,Object UpdateLinks,Object ReadOnly ,对象格式,对象密码,对象WriteResPassword,Object IgnoreReadOnlyRecommended,Object Origin,Object Delimiter,Object Editable,Object Notify,Object Converter,Object AddToMru,Object Local,Object CorruptLoad)
场所Util.ExecApp(String filename,String action ,FormBase表单,布尔showDialog)
场所ReceiveHistory.btnAttachPrint_Click(Object sender,EventArgs e)源码:
Microsoft.Office.Interop.Excel.Application myExcel = new Microsoft.Office .Interop.Excel.Application();
myExcel.Visible = true;
缺少对象= System.Reflecti on.Missing.Value;

myExcel.Application.Workbooks.Open(文件名,丢失,丢失,丢失,丢失,丢失,丢失,丢失,丢失,丢失,丢失,丢失,
缺失,丢失,缺失);

myExcel.Application.ActiveWorkbook.RunAutoMacros(
Microsoft.Office.Interop.Excel.XlRunAutoMacro.xlAutoOpen); // xlAutoOpen:1
myExcel.Application.ActiveWorkbook.PrintOut(缺失,缺失,1,缺失,缺失,缺失,真实,缺失);
myExcel.Quit();
myExcel = null;

解决方案

这个问题最好在Excel编程论坛中提出。
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft .public.excel.programming

when I using C# and print a excel file , then i get there exception.
can you tell me a cause?

2009-03-19 13:16:26 [1] ERROR System.Runtime.InteropServices.COMException (0x800706BE): リモート プロシージャ コールに失敗しました。 (HRESULT からの例外: 0x800706BE)
   場所 Microsoft.Office.Interop.Excel.Workbooks.Open(String Filename, Object UpdateLinks, Object ReadOnly, Object Format, Object Password, Object WriteResPassword, Object IgnoreReadOnlyRecommended, Object Origin, Object Delimiter, Object Editable, Object Notify, Object Converter, Object AddToMru, Object Local, Object CorruptLoad)
   場所 Util.ExecApp(String filename, String action, FormBase form, Boolean showDialog)
   場所 ReceiveHistory.btnAttachPrint_Click(Object sender, EventArgs e)


Source:
Microsoft.Office.Interop.Excel.Application myExcel = new Microsoft.Office.Interop.Excel.Application();
myExcel.Visible = true;
object missing = System.Reflection.Missing.Value;

myExcel.Application.Workbooks.Open(filename, missing, missing, missing, missing,
                               missing, missing, missing, missing, missing, missing, missing,
                               missing, missing, missing);

myExcel.Application.ActiveWorkbook.RunAutoMacros(
Microsoft.Office.Interop.Excel.XlRunAutoMacro.xlAutoOpen); //xlAutoOpen : 1
myExcel.Application.ActiveWorkbook.PrintOut(missing, missing, 1, missing,
                                            missing, missing, true, missing);
myExcel.Quit();
myExcel = null;

解决方案

This question should be best asked in Excel Programming Forum.
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.excel.programming


这篇关于System.Runtime.InteropServices.COMException(0x800706BE)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆