Scilab Home Page | Wiki | Bug Tracker | Forge | Mailing List Archives | Scilab Online Help | File Exchange
ATOMS : xls link details
Login with GitLab

xls link

xls_link (Automation link with Excel) A easy way to call excel(TM) from Scilab
(1357 downloads for this version - 60645 downloads for all versions)
Details
Version
0.3.2
A more recent valid version with binaries for Scilab 5.4 exists: 0.3.4
Authors
Allan CORNET
Antoine ELIAS
Owner Organization
Scilab
Maintainer
Antoine ELIAS
Category
License
Creation Date
March 29, 2013
Source created on
Scilab 5.4.x
Binaries available on
Scilab 5.4.x:
Windows 32-bit Windows 64-bit
Install command
--> atomsInstall("xls_link")
Description
            xls_link (Automation link with Excel) A easy way to call excel(TM) from Scilab
            
Files (3)
[157.42 kB]
Source code archive

[239.23 kB]
Windows 32-bit binary for Scilab 5.4.x
Windows 32-bit
Automatically generated by the ATOMS compilation chain

[241.28 kB]
Windows 64-bit binary for Scilab 5.4.x
Windows 64-bit
Automatically generated by the ATOMS compilation chain

News (0)
Comments (6)     Leave a comment 
Comment from Ben Reily -- April 17, 2013, 02:57:57 PM    
I have tested this version too.
I encounter the same problem here.

There's a bug with xls link and Scilab 32 bit.
When I use SetWorksheet an error comes out.
It's impossible the Set a Worksheet.

This bug affects only 32 bit xls link version. I usa also 64 bit version and there aren't
no bugs.

I have to use the code I have written on computers based on x86 and x64 so I need that xls
link 32 bit work correctly.

This is the code that doesn't work properly

/Open Excel
path_dir = "your_path_dir"
excelfileName=([path_dir + "test.xls"]);
r = xls_NewExcel();

r = xls_Open(excelfileName);
//xls_SetVisible(%t);

xls_callMethod("application", "workbooks", 1) //select first workbook

// Read Serial
xls_SetWorksheet(1);

It crash on xls_SetWorksheet instruction.

If you can fix it, I will appreciate a lot.
If you need more datail to fix this bug I'm here to help.

Thank You
Comment from Antoine ELIAS -- April 17, 2013, 03:32:22 PM    
Hi,

I ran your test case on my computer ( Win 8 64 bits with scilab 5.4.1 32bits and Excel
2003 SP3 ).

-->[a,b] = getversion()
 b  =
 
!ICC  x86  tk  modelicac  release  Mar 29 2013  17:40:34  !
 a  =
 
 scilab-5.4.1   
 

-->atomsGetInstalled()
 ans  =
 
!xls_link  0.3.2-1  user  SCIHOME\atoms\xls_link\0.3.2-1  I  !

--> xls_GetExcelVersion()
 ans  =
 
 11.0   


excelfileName = xls_getRootPath() + "tests\unit_tests\xls_CopyDataRange.xls";
xls_NewExcel();
xls_Open(excelfileName); //auto select last opened workbook and its first worksheet.

//you do not need anything more.
//the tip with xls_callMethod was only when you recovery an existing excel.
//but if I try to execute others commands :

-->xls_callMethod("application", "workbooks", 1)
 ans  =
 
  T  
 
-->xls_SetWorksheet(1)
 ans  =
 
  T  


It is not easy to fix a bug that I cannot reproduce. Let's me find and check on a windows
32 bits and I came back to you, perhaps with good news.

Thanks for reporting.
Antoine
Comment from Ben Reily -- April 17, 2013, 07:52:26 PM    
I know that isn't easy.
I'm using too a Windows 7 64 bit version to build the Scilab script and it work s fine,
but the problem is on windows 32 bit.
Both windows 7 and Xp 32 bit version report an error when trying xls_SetWorksheet.

If you don't have a computer with Win 32 you can use Virtual Machine as Virtual Box
(that's open and free ^^) or VMWare (which I prefer, but you have to pay).

In a Virtual Machine you can install Windows 32 bit (Xp, Vista, 7, 8, ecc. ) is a better
choise. So you can have all the running operative system you want. ^^

I use a lot when I have to check if the program I write working properly on other systems.

If you need other information about the configuration I was using when the bug appears or
other information I'm here to help you.

Many Thanks!!
Comment from Alessandro Zaupa -- May 6, 2013, 02:47:59 PM    
Hi everyone,
I'm using the 64 bit version with Scilab 5.4.1 and Windows 7 Italian.
My computer is configured to use the dot (".") as the decimal separator, and in
Excel and
Scilab everything works fine.
However, when I use xls_link and I read an Excel range with xls_GetData(Range),
I get the numbers with comma(",") as a decimal separator, so the conversion with
strtod()
gives me wrong results.
Is there a way in xls_link to force it to use the dot as a decimal separator?

Thankyou in advance.

Alessandro
Comment from Ben Reily -- May 7, 2013, 07:08:01 PM    
If your numbers are string you can replace comma with dot.
I think the best way is to replace comma in the excel file (CTRL+SHIFT+T), but I think you
can replace also with Scilab using the string as an array of char.
After you have replaced commas with dot I think that it will works.

This solution helps you? 
Let me know, please. ^^
Answer from Alessandro Zaupa -- May 16, 2013, 11:36:47 AM    
Hi Ben,
Thanks for your reply.

I resolved the problem choosing English as the default language in Scilab (by default it 
was Italian) and by default it takes the dot as the decimal separator.
Everything is OK :-)
Comment from Christian Leray -- May 14, 2013, 01:32:01 PM    
Hi,

Very useful module!
I encounter an issue with Xls_SetData() that don't work properly when the specified range
 is a row.

For exemple, Xls_SetData("A1:B1",["mois:","Cumul:"]) gives
the following result:
cell A1= "mois:" and cell B1 "mois:" 
instead of:  cell A1= "mois:" and cell B1 "Cumul:".

It works properly when ranges are columns or more than two rows.

I use windows7, Excel 2010 and Scilab 5.4.1.

Best regards
Leave a comment
You must register and log in before leaving a comment.
Login with GitLab
Email notifications
Send me email when this toolbox has changes, new files or a new release.
You must register and log in before setting up notifications.