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
 open multiple Excel Files
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

superklee

Germany
Posts

Posted - 12/07/2004 :  03:47:09 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 6.1
Operating System: Windows 2000

Hi everybody,

Im trying to open a selection of multiple Excel files in Origin via labtalk.
First iv been trying to open them as origin worksheets

getfilename -m *.*; // prompt for multiple files
system.Excel.OpenAsExcel=0; // open as origin worksheet
system.Excel.OpenAsPrompt=0; // no prompt
menge = count;
loop (ii, 1, menge)
{getfile -g ii;
doc -a %A;};

This works fine in the first loop but origin shuts itself down during the second loop.
I also tried this

run.section(file, Init);
fdlog.usegroup(EXCEL);
fdlog.multiopen();
system.Excel.OpenAsExcel=0;
system.Excel.OpenAsPrompt=0;
loop (ii, 1, fdlog.multiopen.count)
{fdlog.get(A, ii);
doc -append %A;}

after reading in this forum, but I think it's pretty much the same thing and Origin also closes itself in the second loop.
When I open the excel files as Excel Workbooks, everything works fine, but then i don't know how to determine the number of sheets within each workbook.

Did i forget a command to kind of like reset everything, since it worked in the first loop. Or can the doc -a command not be executed twice after another? Is there maybe another way to work around it?

Thanks

Anita

superklee

Germany
Posts

Posted - 12/09/2004 :  09:05:28 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Nevermind,

I figured it out. I forgot to reassign some variables. at least it works now.

Greetz
Anita
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