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
 Copy short name
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

kdsaransh

India
89 Posts

Posted - 12/16/2016 :  06:08:17 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
HI

I want to copy the short name of 10 workbook into column A of another workbook named Book1. I am not able to do so. Pleas help....



Regards,
Rajesh Agarwal

cpyang

USA
1406 Posts

Posted - 12/17/2016 :  10:33:48 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This will do, assuming you have a recent enough version of Origin


range rn=[book1]1!col(a);
int ii=1;
doc -e W {
	string sB$=%H;
	if(sB.CompareNoCase("Book1")!=0)
	{
		rn[ii]$=sB$;
		ii++;
	}
}



CP
Go to Top of Page

kdsaransh

India
89 Posts

Posted - 12/17/2016 :  11:47:21 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks,

I have 9.1 version.

The output if the code is as shown in the picture. The 1st row do not have any data(1khz9). Also the name of the workbook in Book1 is not in sequence.

Any help.

Thanks again
Regards,

Go to Top of Page

cpyang

USA
1406 Posts

Posted - 12/18/2016 :  11:11:55 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Don't know why, I used 2017 to test this code. Consider upgrade to current version.

Looks to me all the names are there, so you can also test for empty book name, not sure why it happened, like I said, 9.1 is very old version.

CP
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