未处理的异常:System.Runtime.InteropServices.COMException(0x800A03EC) [英] Unhandled Exception: System.Runtime.InteropServices.COMException (0x800A03EC)

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

问题描述

我有一个导出Excel文件的C#应用​​程序。当我从Visual Studio运行它,它的工作正常。但是,当我安排它从SQL Server代理程序运行时,它失败,出现以下错误:


未处理的异常:System.Runtime.InteropServices .COMException(0x800A03EC):由于没有足够的可用内存或磁盘空间,Microsoft Office Excel无法打开或保存更多文档。为了使更多内存可用,请关闭不再需要的工作簿或程序。要释放磁盘空间,请从要保存的磁盘中删除不再需要的文件。


我搜索了很多链接,而他们说这可能是一个许可问题。所以我根据Stack Overflow中提供的解决方案应用了以下的事情,但没有运气。


  1. 创建目录C:\ Windows \SysWOW64\config\systemprofile\Desktop(对于64位Windows)


  2. 应用对我的域用户的目录桌面的完全控制权限, SQLServiceAgent


我在MS Excel 2007中使用SQL Server 2014和Win 2012 Edition。



任何人都可以帮忙?

解决方案

我发现在DCOM配置中缺少Microsoft Excel应用程序。所以,我做了以下步骤:


  1. 开始

  2. 运行

  3. mmc -32

  4. 文件

  5. 添加删除管理单元

  6. 组件服务<
  7. 添加

  8. 确定

  9. 控制台根

  10. 组件服务

  11. 电脑

  12. 我的电脑

  13. DCOM配置

  14. - >右键 - >属性

  15. 在安全性选项卡上,为域用户和NT SERVICE\SQLSERVERAGENT授予完全权限:
    a。启动和主动权限
    b。访问权限
    c。配置权限

  16. 在Identiy选项卡 - >更改为Interactive User

就是这样。我运行了SQL作业,并且成功了。


I have a C# application that exports an Excel file. When I run it from Visual Studio, it is working fine. However, when I schedule it to run from SQL Server Agent, it failed with the following error:

Unhandled Exception: System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Office Excel cannot open or save any more documents because there is not enough available memory or disk space. To make more memory available, close workbooks or programs you no longer need. To free disk space, delete files you no longer need from the disk you are saving to.

I have searched many links, and they say it could be a permission issue. So I applied the things below per the solutions provided in Stack Overflow, but no luck.

  1. Created directory "C:\Windows\SysWOW64\config\systemprofile\Desktop " (for 64 bit Windows)

  2. Applied Full control permissions for directory Desktop for my domain user, SQLServiceAgent

I'm using SQL Server 2014 and Win 2012 Edition with MS Excel 2007.

Can anyone help?

解决方案

I tried this and it worked. I found "Microsoft Excel Application" is missing in DCOM Config. So, I did the following steps:

  1. Start
  2. Run
  3. mmc -32
  4. File
  5. Add Remove Snap-in
  6. Component Services
  7. Add
  8. OK
  9. Console Root
  10. Component Services
  11. Computers
  12. My Computer
  13. DCOM Config
  14. Microsoft Excel Application -> Right click -> Properties
  15. On Security tab, give full permissions to the domain user and NT SERVICE\SQLSERVERAGENT on: a. Launch and Active Permissions b. Access Permissions c. Configuration Permissions
  16. On Identiy tab -> change to Interactive User

That's it. I ran the SQL job and it succeeded.

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

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