none
Workbooks.Open gives error “The remote procedure call failed” RRS feed

  • Question

  • I have a MFC C++ unmanaged application that uses EXCEL to open *.xlsx and *.csv files.

    This feature can be called directly from an MFC Windows Application or from a Windows Service.

    Most of times this works without any problem.

    Now I am having problems reading *.csv files, and gives the error “The remote procedure call failed.” in method “Workbooks.Open(…)”.

    Runs well when open the *.csv file directly from MFC Windows Application, and runs well to when open the *.xlsx file from both MFC Windows Application and Windows Service.

    I am running in a machine with Windows 2012 R2/Office 2013 (I had other machine with “Windows 2012 R2/Office 2013” that works well).

    What could be?

    I already tried some of web suggestions without any success.

    Thanks & regards

    Rui

    Monday, December 11, 2017 4:49 PM

Answers

  • I found a solution, running the service in an account "Log on as: This account: ..."!

    But still not understanding why works for *.xlsx files and not for *.csv files?

    And why in some machines with apparently the same configuration (same OS and Office) works well for both files?

    Thanks & regards,

    Rui

    Monday, December 11, 2017 6:31 PM

All replies

  • I have a MFC C++ unmanaged application that uses EXCEL to open *.xlsx and *.csv files.

    This feature can be called directly from an MFC Windows Application or from a Windows Service.

    Most of times this works without any problem.

    Now I am having problems reading *.csv files, and gives the error “The remote procedure call failed.” in method “Workbooks.Open(…)”.

    Runs well when open the *.csv file directly from MFC Windows Application, and runs well to when open the *.xlsx file from both MFC Windows Application and Windows Service.

    I am running in a machine with Windows 2012 R2/Office 2013 (I had other machine with “Windows 2012 R2/Office 2013” that works well).

    What could be?

    I already tried some of web suggestions without any success.

    Thanks & regards

    Rui

    Monday, December 11, 2017 4:38 PM
  • I found a solution, running the service in an account "Log on as: This account: ..."!

    But still not understanding why works for *.xlsx files and not for *.csv files?

    And why in some machines with apparently the same configuration (same OS and Office) works well for both files?

    Thanks & regards,

    Rui

    Monday, December 11, 2017 6:31 PM
  • I found a solution, running the service in an account "Log on as: This account: ..."!

    But still not understanding why works for *.xlsx files and not for *.csv files?

    And why in some machines with apparently the same configuration (same OS and Office) works well for both files?

    Thanks & regards,

    Rui

    Monday, December 11, 2017 6:32 PM
  • If you want an answer then you need to provide relevant code.


    Sam Hobbs
    SimpleSamples.Info

    Monday, December 11, 2017 7:23 PM
  • Hi Rui,

    Microsoft does not currently support automation of Microsoft Office applications from server side, because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment. And I would suggest you develop and debug your application on a Windows Client Operating System. 

    For more information, you could try to refer to below link.

    Considerations for server-side Automation of Office

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, December 12, 2017 1:48 AM
  • Hi,

    Based on your description, I'll move your question to the MSDN forum for Excel

    https://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.


    Regards,

    Emi Zhang


    Please remember to mark the replies as answers if they helped.
    If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Tuesday, December 12, 2017 7:50 AM