开发者

Com error 800a03ec when i call PrintPreview() method of workbook

Show message of Com error 800a03ec when i can PrintPreview() of workbook

m_spWorkbook->PrintPreview();

i get m_spWorkbook in the following code:

hr = spOleObject->QueryInterface(__uuidof(_Workbook), (void**)&m_sp开发者_开发百科Workbook);

what's the problem?


Exception 800a03ec often means problem with locale. For example, language in Excel differs from regional settings. Have a look at these links:

  • http://blogs.msdn.com/b/eric_carter/archive/2005/06/15/429515.aspx
  • http://support.microsoft.com/kb/320369

As I understood from your other question, HRESULT 0x800a03ec throwing may be assotiated with instances of Excel. Perhaps, in moment, when you are calling printPreview application is already closed or you are trying create additional instance of Excel or user editing in your instance of Excel


I'm not sure, but this may have to do with Security Permissions. My hunch would be (I haven't tested this specifically), that PrintPreview internally uses macro functions or is trying to get access to VBA Project model; either of which may be denied if the macro security is set to default level (or higher!).

Try giving VBA Macros "Enable all macros" security level to see if this solves the problem. If it does then you will probably want to have a signed application whose certificate is trusted by VBA in production environment. Or you can lower VBA security on all involved computers but of course that isn't recommended at all.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜