none
How to find which tables are in the active sheet RRS feed

  • Question

  • I'm playing around with the apps for office javascript API, using excel online. I want to do something which seems super basic but i can't find out how to.

    How do you find out which tables exist (this would be like lisobjects in vba) in the currently active sheet?

    I'd like to be able to use something like this without actually having to know in advance the name of the table. 

    Office.context.document.bindings.addFromNamedItemAsync("Table1", "table", {id:'myTable'} ...


    thanks for any insight.


    ramblings.mcpher.com

    Wednesday, September 9, 2015 4:01 PM

Answers

  • Hi bruce,

    >>How do you find out which tables exist (this would be like lisobjects in vba) in the currently active sheet?<<

    There is no such method or property we can ahceve thie goal in JavaScript API for Office. As a workaround, we can bind the object via selection by using Bindings.addFromSelectionAsync.

    And if you want JavaScript API to support the the tables in active worksheet, you can try submit the feedback from link below:
    Customer Feedback for the Office Developer Platform

    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.

    Thursday, September 10, 2015 2:03 AM
    Moderator

All replies

  • Hi bruce,

    >>How do you find out which tables exist (this would be like lisobjects in vba) in the currently active sheet?<<

    There is no such method or property we can ahceve thie goal in JavaScript API for Office. As a workaround, we can bind the object via selection by using Bindings.addFromSelectionAsync.

    And if you want JavaScript API to support the the tables in active worksheet, you can try submit the feedback from link below:
    Customer Feedback for the Office Developer Platform

    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.

    Thursday, September 10, 2015 2:03 AM
    Moderator
  • Thanks for the feedback. That's what I suspected. 

    The problem with the addFromSelectionAsync method though, is that the user needs to be positioned on the target table (for example there may be 2 in a sheet), and in any case it would be a table binding that would be required, not a range selection. 

    What I really want to be able to do is to find out the usedatarange of a sheet (whether or not there is a table created), and to do something if that useddatarange changes. 


    bruce mcpherson

    Friday, September 11, 2015 10:13 AM
  • btw - the link to the survey is broken...

    bruce mcpherson

    Friday, September 11, 2015 10:14 AM
  • Hi Bruce,

    Thanks for the detail information for this issue and the feedback for the survey link.

    I suggest that you submit the feedback if you want any new feature in Office add-ins base on the link above. And I am also trying to report the broken link issue for the survey.

    Thanks for your understanding.

    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, September 14, 2015 8:01 AM
    Moderator