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
 Forum for Origin C
 A bug in "Add Layer" function?

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
Gutalin Posted - 10/18/2010 : 07:11:21 AM
Origin Ver. and Service Release (Select Help-->About Origin): 8
Operating System: Win XP

Hello again,

I'm trying to add some worksheets to my active workpage by using
the "wks.AddLayer("name")-function.
But when I execute my script this error warning apears:
(...\OriginLab\Origin8\OriginC\OriginLab\SCRIPTWINDOW.H(470) :Laufzeitfehler in Origin C Funktion, Fehler bei Aufruf externer Funktion)
and Origin shuts down.

Could you help me please? I just want to add a layer...

Regards, Gutalin
3   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 11/05/2010 : 12:30:47 PM
This code works fine in Origin 8 or later as long as workbook is active:

void testAddLayer()
{
Worksheet wks = Project.ActiveLayer();
if(!wks) return;
WorksheetPage wp = wks.GetPage();
wp.AddLayer("name");
}

Post your code that does not work.
Gutalin Posted - 11/04/2010 : 08:00:45 AM
Hi Penn,

thank you very much for your response.
I tried to use your code, like before I have no problems compiling the script but I still get the same error-warning from executing it.
Is there any other possibilty to add a worksheet to a workbook without using "wp.AddLayer"?

Regards, Gutalin
Penn Posted - 10/18/2010 : 11:27:50 PM
Hi Gutalin,

wks in your code means a worksheet, right? There is no AddLayer method for Worksheet class. This method is for Page class. You can refer to examples in this page for more information about how to use this method.

For your issue, you can use like:

Worksheet wks = Project.ActiveLayer();  // get active worksheet
if(!wks)
	return;
	
WorksheetPage wp = wks.GetPage();  // get the workbook of the worksheet
wp.AddLayer("name");  // add worksheet to the workbook


Penn

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