I'm having a problem with the properties of my worksheet. I used a script for setting the type of a column. It worked 2 or 3 times and afterwards the mentioned properties were missing
Output wks.col2.name$=; WKS.COL2.NAME$=--
I'm using Origin 6.1. and the worksheet is rather large (about 11MB). The script was using this loop to find the wanted column (script from another topic in this forum)
Also, you will always get a null result if you try to access a text property with object.textproperty$=;. You need to do assign it to a text variable as you've done in your loop...
%B=wks.col2.name$; %B=;
...Which brings us back to the question of why your script doesn't work. I can see nothing wrong with it and it works when I try it.
Where is the script? This script assume the worksheet as the active window. Maybe you are running this script and in that context the worksheet is not the active window? In that case, you will need to use things like win -o myWksName {....}