none
System.Runtime.InteropServices.COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC RRS feed

  • Question

  •  

    Hi

     I am created Excel sheet application using VS2010. It is working fine in my system.

     If i run the same sheet in another system getting error ..

    Exception rethrown at [0]:

       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)

       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

       at Microsoft.Office.Interop.Excel._Workbook.get_VBProject()

       at Microsoft.Office.Tools.Excel.Workbook.get_VBProject()

     Error line code

    Microsoft.Office.Tools.Excel.Worksheet vstoWs = null;
                        object temp = Globals.ThisWorkbook.VBProject;
                        vstoWs = WorksheetExtensions.GetVstoObject(newWorksheet);

    I am using VSTO Excel 2010, Language. Both system are running same version of excel 2010.

    I already enabled the Trust Access to VBA in Excel 2010 .

    Wednesday, December 12, 2012 3:14 PM

Answers

All replies

  • Hi SIVAM,

    Thank you for posting in the MSDN Forum.

    It will be nice if you could upload a sample project that could reproduce your scenario. You can upload it to SkyDrive make it accessible and share the link.

    Currently, judging by the information you've provided, I think you're facing "Programmatic access to Visual Basic Project is not trusted" Error. If so, you can take a look at this thread which might contain useful information to solve your issue.

    Hope it helps.

    Best regards,


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, December 13, 2012 9:51 AM
    Moderator
  • Hi Quist Zhang

    I have uploaded the sample application in Sky drive.  Please download it.  http://sdrv.ms/UFTnMK

    I am facing error in com level “System.Runtime.InteropServices.COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC”

    I error is not related to "Programmatic access to Visual Basic Project is not trusted" error, because I have already enabled the Trust Access to VBA in Excel 2010, followed by below URL  

    http://wise.winshuttle.com/article/AA-02988/0/Error-Programmatic-Access-To-Visual-Basic-Project-Is-Not-Trusted.html

    Please help me

    Thursday, December 13, 2012 12:43 PM
  • Hi SIVAM,

    Thank you for your last reply.

    I've just download the project file. Currently I've found that you have multiple using System.Data; in your code in Sheet1.cs file.

    using System;
    using System.Collections.Generic;
    using System.Data;  //The 3rd line.
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.Xml.Linq;
    using Microsoft.VisualStudio.Tools.Applications.Runtime;
    using Excel = Microsoft.Office.Interop.Excel;
    using Office = Microsoft.Office.Core;
    using Microsoft.Office.Tools.Excel.Extensions;
    using System.Data;  //The 12th line.

    Besides, the first time I run your project an error Occurs but never appear later. I'll reply back if there's any new discovery.

    Have a nice day.


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, December 13, 2012 1:10 PM
    Moderator
  • Hi SIVAM,

    After I extract the project file downloaded from SkyDrive, I opened it with VS and compiled.

    Then Excel opened in protect view

    after I clicked the enable editing, the below exception occurs.

    But later when I re-compiled the project, the exception never occurs.

    Is your scenario similiar to mine? Does the exception occurs when you compile the code later?

    Best regards,


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, December 14, 2012 7:38 AM
    Moderator
  • Hi Quist Zhang

    Thanks for your reply.

    I am also getting same error in client system.

    I already installed Office 2010, Dot net 3.5 and Microsoft Office 2010: Primary Interop Assemblies Redistributable setup files in client system.   

    Friday, December 14, 2012 8:31 AM
  • Weird Issue. As mentioned by Quist,

    Does the exception occurs when you compile the code later?

    I think this might be related to authority since Quist said that the workbook was opened in protect view in the first time .


    Regards,
    Fermin
    What's life without whimsy?

    Friday, December 14, 2012 8:54 AM
  • Hi Quist Zhang


     I am facing the above issue only in particular system. The VSTO excel application is working fine in rest of system.

    I got the tool “Microsoft PSS VSTO 2005 Client TroubleShooter “from Microsoft side. The tool scans the client computer for the prerequisites required to run a VSTO 2005 solution.

     But it’s not supporting for office 2010.

    Is any the other tool is available for VSTO 2010 solution?

    with Regards

    solai


    Tuesday, December 18, 2012 5:35 AM
  • Hi SIVAM,

    Thank you for your last reply.

    I've found the below pages for you

    You can check these pages and see whether they can help you or not.

    Hope it helps.

    Best regards,


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, December 19, 2012 8:19 AM
    Moderator
  • I have meet your problem,  if opened excel file is in Protected View,  when open the excel file will throw the COMException,  I think you can get the help from the following link:

    Worksheet.Activate() fails after enabling editing from Protected View in Excel 2010

    I think you can use the ProtectedViewWindowOpen event of the Application class in Excel

    If you have any question, please let me know.

    Thanks

    Thursday, December 20, 2012 4:11 PM