locked
Handling of clipbard comming from Excel RRS feed

  • Question

  • Hello,

    I am trying to find a way to detect that the clipboard contains data that comes from Excel... Is there an easy way to do that in C/C++?

    As a secondary item, how would I get access at the formulas associated with the cells copied in the clipboard.

    Cyrille

    Friday, December 12, 2014 11:17 AM

Answers

  • Hi Cyrille,

    In this document, it described the Clipboard formats supported by Excel.
    File formats that are supported in Excel # Clipboard formats

    >> BUT I am still unable to reach my primary goal which is to access to the formulas

    Based on my understanding, besides system clipboard, Office has a dedicated clipboard (Office clipboard) for data exchange inner the Office applications, and I don't think it is accessible from system clipboard.

    As a workaround, I suggest that you paste the range to a template workbook and get the formula via Range.Formula.

    Hope it is helpful.

    Regards & Fei


    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.

    Tuesday, December 16, 2014 8:11 AM
  • Hi Cyrille,

    Based on the description, you want to get the data from clipboard which copied from Excel.

    Did it work for you past the data to a temporarily workbook and then get the data via Excel object model?

    If yes, here is an article about Office automation using C++ for your reference:
    Office Automation Using Visual C++

    Regards & Fei


    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.

    Monday, December 15, 2014 2:38 AM

All replies

  • Hello Cyrille,

    I'd suggest asking Excel specific questions on the Excel for Developers forum instead.

    Saturday, December 13, 2014 1:54 PM
  • Hi Cyrille,

    Based on the description, you want to get the data from clipboard which copied from Excel.

    Did it work for you past the data to a temporarily workbook and then get the data via Excel object model?

    If yes, here is an article about Office automation using C++ for your reference:
    Office Automation Using Visual C++

    Regards & Fei


    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.

    Monday, December 15, 2014 2:38 AM
  • Hello,

    I am now able to access to the Csv data (which tells me that the clipboard is a 'table' type), BUT I am still unable to reach my primary goal which is to access to the formulas.

    ie, someone, in excel, selects and copy to the clipboard a number of cells and I want, for each of these cells to get the formula associated with them. Not the value (which I do get through the CSV format)...

    Any article/example code showing how to do that?

    Cyrille

    Monday, December 15, 2014 10:27 AM
  • Hi Cyrille,

    In this document, it described the Clipboard formats supported by Excel.
    File formats that are supported in Excel # Clipboard formats

    >> BUT I am still unable to reach my primary goal which is to access to the formulas

    Based on my understanding, besides system clipboard, Office has a dedicated clipboard (Office clipboard) for data exchange inner the Office applications, and I don't think it is accessible from system clipboard.

    As a workaround, I suggest that you paste the range to a template workbook and get the formula via Range.Formula.

    Hope it is helpful.

    Regards & Fei


    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.

    Tuesday, December 16, 2014 8:11 AM