The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 creating named columns

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
kemeyer Posted - 07/12/2010 : 10:52:49 AM
Origin Ver. 8.1 and SR 6
Operating System: Vista

I was hoping someone could explain to me why Origin did this in my program:

I have a worksheet with columns A and B to start, as as my program runs, it adds columns C, D, E, F, and G. Finally it adds a column H. However, I just had my program stop working today, and I realized that is because rather than wks.addCol(H) adding a column labeled H as it had in the past, it inserted one labeled H1.

Why did this change? I have been adding alterations to the program, but I commented all of them out and it still does this. I also tried restarting the computer, but the problem persists. I used the wks.addCol(H) command on the other workbooks created, and it added a column labeled H as expected, but it seems like the first book it adds it as H1, which crashes my program. Do you have any ideas or suggestions as to why this is happening or how to remedy it?

Thanks,
Katie
3   L A T E S T    R E P L I E S    (Newest First)
kemeyer Posted - 07/13/2010 : 1:14:58 PM
I will try the delete column H. That should work for what I am trying to do...Thanks, I didn't even think of trying to do that.
larry_lan Posted - 07/12/2010 : 10:02:25 PM
Hi:

Not sure what's your problem before looking into your code. If the script is short, please paste it here. Or, you can send the OGS file to us.

Could you try to replace wks.addcol(H) by the following script to see if it work?

{ del col(H); }
wks.addcol(H);

The curly braces ("{" and “}”) here is used to enclose scripts that might generate an error. So, you can try to clear column H before adding it.

Thanks
Larry
OriginLab Technical Services
kemeyer Posted - 07/12/2010 : 11:07:35 AM
Correction: it seems to only be making column H1 in Book5.

My program loops through the colums of Y data in a workbook and creates multiple books labeled Book1, Book2, Book3...etc for each dataset contained in that original workbook. In each of these Book1,2,3..etc, it contains an x and y column, in addition to all the columns I add up to column H. For whatever reason, in Book5, it seems to think there is a column H already present because it creates column H1 when I specify to add column H with wks.addcol(H). When I leave it blank and enter just wks.addcol(), it makes column I. I'm still lost as to what made this occur...

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000