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
 Duplicate workbook takes ages to complete
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Clairekun

Germany
175 Posts

Posted - 08/11/2020 :  2:34:25 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 2018b
Operating System: Windows 10

Hello,

I have a set of workbooks I need to duplicate and rename. While
win -d Duplicate;
achieves it instantaneously for the selected workbook, assigning the name to a string makes the process much, much slower. I'm talking about 2-3 minutes per workbook, if I'm really lucky. I'm using
string sname$ = page.name$;
string TernSName$ = Substitute(sname$,t3,t1,1)$;
window -d %(TernSName$);


Since I need this to be run on multiple workbooks, it is taking painfully long; I have about 15 workbooks, and it needs over 30 minutes.

Is there any reasoning behind this, or any other faster way I could do it?

Each workbook has multiple worksheets, in case it is of any relevance.

Thank you.

Clairekun

Germany
175 Posts

Posted - 08/13/2020 :  1:44:33 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I found the problem.

I created a new project with similar features than the original one; multiple folders, multiple workbooks, multiple worksheets per workbook. Renaming did not take too long, so the code itself was not the problem.

I had imported multiple workbooks, with operations like merging and splitting workbooks. This left some residual data which was bloating the whole file. I did suspect this had something to do with the issue, but certainly not to this extent.

As soon as I ran
del -as
things went much, much faster. It went from over 4 hours (my prior estimation of about 30 minutes was very inaccurate) to a mere 2 minutes.

I included these leftovers removal in my importing code, and things were also much faster.

To anyone experiencing this issue, I recommend https://www.originlab.com/doc/Quick-Help/ProjectFile-Very-Slow.

Thank you!
Go to Top of Page

lkb0221

China
497 Posts

Posted - 08/18/2020 :  09:04:43 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Those hidden loose datasets might be caused by one deleting his/her workbooks using window -c instead of -cd. Or created too many project-level variables during the script.
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