locked
Reading, Writing and Editing the excel file using C++ application RRS feed

  • Question

  • Hi All,

    My requirement is to develop C/C++ application to create,write/edit the values into excel and read the values from excel.

    I have checked below links and found that we can implement by importing MSO.DLL and EXCEL.exe.

    https://support.microsoft.com/en-us/help/308407/how-to-automate-excel-from-mfc-and-visual-c-2005-or-visual-c--net-to-f

    https://support.microsoft.com/en-us/help/216686/how-to-automate-excel-from-c-without-using-mfc-or-import

    http://www.technical-recipes.com/2012/how-to-interface-with-excel-in-c/

    I found that code we need to modify for different excel version (2003/2007/2013 etc). Is it possible to write generic application for excel operation irrespective of Microsoft Excel version? or on any run time method possible to make application run on any Windows OS/any Microsoft Office version? 

    Thanks and regards,

    Krishna 

    Friday, October 6, 2017 8:28 AM

All replies

  • Hi Krishna,

    I would suggest you use Excel XLL SDK for development. Please refer to below link for more help.

    https://msdn.microsoft.com/en-us/library/bb687883.aspx

    Besides, you could also refer to below tutorial regarding to C++ and interfacing with Excel for reference.

    http://www.maths.manchester.ac.uk/~ahazel/EXCEL_C++.pdf

    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.

    Monday, October 9, 2017 10:04 AM
  • Dear Terry,

    Thanks for your reply.

    From the link, It looks like SDK is for Excel 2013. Whether same application will work on higher(Excel 2016) or older version(Excel 2007/2010) of Microsoft Excel? 

    My query is whether we can make generic application which will work on any version of Microsoft Excel? or any run time method possible to make application run with any Microsoft Office version? 

    Regards,

    Krishna


    • Edited by KP_KS Tuesday, October 10, 2017 7:06 AM
    Tuesday, October 10, 2017 7:05 AM
  • Hi Terry,

    We tried Microsoft SDK. It is working fine in one Excel version. But If we use same application with different Excel version, It is not working properly.

    Please provide your feedback.

    Regards,

    Krishna

    Thursday, October 12, 2017 1:25 AM
  • Hi KP_KS,

    You could try to develop a Cross-Version XLL, please refer to below link for more information.

    https://msdn.microsoft.com/en-us/library/aa730920(v=office.12).aspx#Writing Cross-Version XLLs

    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.

    Thursday, October 12, 2017 9:23 AM
  • Hi Terry,

    Thanks for your reply.

    We are checking cross-Version XLL. In current link example provided for Excel 2007 version. Whether we need to use third party tool with XLL for performing Excel read and write functionality? With this whether we can run same application on the system having higher version of Excel (2010/2013/2016)?

    Thanks and Regards,

    Krishna

    Thursday, October 19, 2017 8:48 AM
  • Hi KP_KS,
    I think it could work for higher version of Excel. You could create a simply project for testing.
    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.

    Monday, October 23, 2017 7:44 AM