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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 creating named columns
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

kemeyer

39 Posts

Posted - 07/12/2010 :  10:52:49 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

kemeyer

39 Posts

Posted - 07/12/2010 :  11:07:35 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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...
Go to Top of Page

larry_lan

China
Posts

Posted - 07/12/2010 :  10:02:25 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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

Edited by - larry_lan on 07/12/2010 10:03:19 PM
Go to Top of Page

kemeyer

39 Posts

Posted - 07/13/2010 :  1:14:58 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000