I'm working on a macro in OfficeScript.
Among other things I need it to check if a column header exists in the given table and add a column if it doesn't exist. This part doesn't seem to work.
Here is the relevant snippet
The office script documentation says that if getColumn should return 'undefined' if a column is not found, so I also tried number of tests for an undefined variable, but all return false.![]()
Please Login or Register to view this content.
https://learn.microsoft.com/en-us/ja...lumn-member(1)
So at this point I am thinking I may need to add a function to loop through all the headers, but that feels like overkill.
Any suggestions?
Here is my full code. I attached a sample workbook with appropriately named worksheet and table.
![]()
Please Login or Register to view this content.
Bookmarks