write string variable to cell in general table

This works:

swTable.Text(i, j) = "123456"

This doesn't work:

strVariable(i, j) = "123456"

swTable.Text(i, j) = strVariable(i, j)

I need the second scenario to work.

SolidworksApi macros