Solved

Definitely some error in getting number of columns using ColumnCount in new tosca 2023.2

  • 1 March 2024
  • 2 replies
  • 17 views

Badge

Is there any issue with the way ColumnCount works in Tosca 2023.2.1 as the same was running just fine in Tosca 16.2. Has anybody faced the same?

I am trying to get total count of columns, but it’s giving me the same number as defined in Tbox Define Excel Range. It should rather give the count of actual columns having data.

icon

Best answer by brendon.russell 12 April 2024, 00:58

View original

2 replies

Badge

Anybody?

Userlevel 3
Badge +1

Anybody?

Is there any issue with the way ColumnCount works in Tosca 2023.2.1 as the same was running just fine in Tosca 16.2. Has anybody faced the same?

I am trying to get total count of columns, but it’s giving me the same number as defined in Tbox Define Excel Range. It should rather give the count of actual columns having data.


I don’t think I’ve ever used ColumnCount in this particular scenario, but the 2023.1 behaviour doesn’t sound unusual to me. The columns still exist in your range, regardless of whether they have data or not. It’s definitely annoying if the behaviour has changed between versions and isn’t documented - have you checked the manual, release notes etc to see if this is mentioned?

Anyhow, it will depend on exactly why you are doing the column count in the first place, but you may just need to update your steps to filter out the empty columns yourself. Unfortunately I don’t think there’s a Column equivalent for lastContentRow or firstEmptyRow, which could have been useful in a case like this.

Reply