none
Error while create query table for Office 365 RRS feed

  • Question

  • Hello Team ,

    We are getting following exception while creating Query Table for office 365 from text file using C# .Net. It is working fine for other office versions.

    Exception:

    Exception in ParseAndLoadCSVs function in Assembling Template Exception from HRESULT: 0x800AC472    at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)

       at Microsoft.Office.Interop.Excel.QueryTables.Add(Object Connection, Range Destination, Object Sql)

       at SWServiceCommonLibrary.Common_Functionalities.TemplateAssembler.ParseAndLoadCSVs(Workbook workbook) Job ID: 65: : TemplateAssembler.ParseAndLoadCSVs

     

    Code Used:

    m_objQryTable = (Excel.QueryTable)worksheet.QueryTables.Add(Connection, worksheet.get_Range(Range[arrlen].ToString(), Missing.Value), Missing.Value);

     

    Can any one tell me  why it is failing in office 365 ??

    Tuesday, September 8, 2015 8:47 AM

All replies

  • Hello Team ,

    We are getting following exception while creating Query Table for office 365 from text file using C# .Net. It is working fine for other office versions.

    Exception:

    Exception in ParseAndLoadCSVs function in Assembling Template Exception from HRESULT: 0x800AC472    at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)

       at Microsoft.Office.Interop.Excel.QueryTables.Add(Object Connection, Range Destination, Object Sql)

       at SWServiceCommonLibrary.Common_Functionalities.TemplateAssembler.ParseAndLoadCSVs(Workbook workbook) Job ID: 65: : TemplateAssembler.ParseAndLoadCSVs

     

    Code Used:

    m_objQryTable = (Excel.QueryTable)worksheet.QueryTables.Add(Connection, worksheet.get_Range(Range[arrlen].ToString(), Missing.Value), Missing.Value);

     

    Can any one tell me  why it is failing in office 365 ??

    • Merged by Kristin Xie Wednesday, September 9, 2015 2:41 AM duplicate case
    Tuesday, September 8, 2015 10:19 AM
  • Hello Siva,

    > for office 365 from text file using C# .Net.

    Where and when do you run the code? Is it a windows service or ASP.NET application?

    Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

    If you are building a solution that runs in a server-side context, you should try to use components that have been made safe for unattended execution. Or, you should try to find alternatives that allow at least part of the code to run client-side. If you use an Office application from a server-side solution, the application will lack many of the necessary capabilities to run successfully. Additionally, you will be taking risks with the stability of your overall solution. Read more about that in the Considerations for server-side Automation of Office article.

    Tuesday, September 8, 2015 10:41 AM
  • Hi SivaPrasanth,

    I made a test with QueryTables.Add under Office 365, but I failed to reproduce your issue. I suggest you test your code in other PCs. If your issue still exists in other pcs, I suggest you share us your simple code, and then we could try to reproduce your issue.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, September 16, 2015 8:50 AM