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
 script for en/disable protection for worksheet
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

imoada

31 Posts

Posted - 10/21/2014 :  04:07:03 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin 9.1 sp3 64-bit
Win7 ultimate sp1

hello

Does anyone know how to use script (LabTalk) to enable/disable "Disable Editing" in "workshee properties -> Format -> Text Control" for "Standard/Data/Column Label/Long Name/Comments" in drop-down list of "apply to", respectively?

Thanks in advance.

Imoada

greg

USA
1378 Posts

Posted - 10/21/2014 :  3:10:27 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Check the Help file for the LAYER command...

layer -lw 2; // Make active sheet READ ONLY
layer -lw 0; // Restore READ/WRITE
Go to Top of Page

imoada

31 Posts

Posted - 10/21/2014 :  6:02:10 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank greg.

I know your answer. "Layer" command can't make change to the check box of "Disable Editing", this may cause coufusions to new origin user. Beside "layer" command, is there any other way to treat worksheet in accordance with my requirement.
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 10/22/2014 :  10:27:56 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi imoada,

There is no simple Labtalk way to control the Disable Editing checkbox in Cell Formatting, or Worksheet Property dialog, even though it can be done using Origin C.

What Greg pointed out is that you may also lock the entire sheet up to prevent editing by simply using the Labtalk command
lay -lw 2

for the active sheet. For more details, see

https://originlab.jira.com/wiki/display/main/Workbook+Protection

or the layer -lw command in

http://www.originlab.com/doc/LabTalk/ref/Layer-cmd#-lw.3B_turn_on_protection_on_worksheet_level


CP
Go to Top of Page

greg

USA
1378 Posts

Posted - 10/23/2014 :  10:00:58 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can turn the Disable Editing checkbox on and off via script using two theme files and the themeApply2w X-Function.
Send an email to tech@originlab with the Subject line Disable Editing Themes and be sure to include your Origin Serial Number in the email.
Go to Top of Page

MaxMace

USA
2 Posts

Posted - 11/06/2014 :  07:54:06 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I've been searching for this for a while. I guess the solution from Greg is the easiest way to do it. I'm pretty new into this thing, so it may take some time for me to figure it out, though. Wish me luck!

It's a beautiful day!
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