MATLAB engine, xlsread, compatibility issues

I wrote an executable in C++ that uses the MATLAB engine to use the function xlsread to read a .xlsm file. It works perfectly on my computer, I am using Windows 7 and have MATLAB version R2012a however, I am trying to put it on a file server (Windows Server 2008 R2 Service Pack 1) and has MATLAB version R2013a. However, when I put it on the server the executable does not work correctly. Does anyone know why this might be happening?
Any feedback that anyone could provide would be extremely helpful.
Thanks!

댓글 수: 8

Does the file server have excel installed ?
Caroline
Caroline 2013년 8월 18일
No, but I'm not sure if thats the issue because it still is able to read some of the excel file, just not all of it. I am reading two different sheets in the excel file. If the two sheets that are being read in the excel file are next to eachother in excel file then the executable seems to work fine, but if they are separated by a sheet or two then the executable does not work.
Image Analyst
Image Analyst 2013년 8월 18일
xlsread() won't work at all if Excel is not installed so because it works somewhat, you must have it installed.
xlsread() would work in 'basic' mode if Excel is not installed.
Image Analyst
Image Analyst 2013년 8월 19일
편집: Image Analyst 2013년 8월 19일
I'm not sure what that is. I know that most of my Excel code won't work on my home computer because I have only Excel "starter version" (i.e. free, not the "full" version) and that version won't work with my ActiveX code, which is how I do most of my Excel work because it's faster.
Caroline
Caroline 2013년 8월 21일
It seems like that Excel was actually the problem. While it can read excel files without excel, I don't think that it can read complicated excel files without excel, that might be basic mode? But it seems to be working with it.
Thanks for your all of your help!
and click on the description of the 'basic' option
Flag to request reading in basic mode, which is the default for systems without Excel for Windows. In basic mode, xlsread:
Reads XLS, XLSX, XLSM, XLTX, and XLTM files only.
Does not support an xlRange input when reading XLS files. In this case, use '' in place of xlRange.
Does not support function handle inputs.
Imports all dates as Excel serial date numbers. Excel serial date numbers use a different reference date than MATLAB® date numbers.
Caroline
Caroline 2013년 8월 22일
Thank you!

댓글을 달려면 로그인하십시오.

답변 (1개)

Image Analyst
Image Analyst 2013년 8월 18일

0 개 추천

Did you also install the R2012a Runtime Component library on the server? It needs to have the same MCR on it that you used to compile your MATLAB module.

댓글 수: 3

Image Analyst
Image Analyst 2013년 8월 18일
Did you compile a MATLAB module, or are you using MATLAB as an ActiveX server?
Caroline
Caroline 2013년 8월 18일
편집: Caroline 2013년 8월 18일
Thanks so much for answering me! I installed a complete version of MATLAB (R2013a) on the file server. Do I also need the MCR? I thought I wouldn't need that if I had a fully installed version of MATLAB. The executable runs, it just does not run the way that it should. I used visual C++ to make the executable. I didn't use ActiveX in my code. The only things I used to communicate with MATLAB in my code was the MATLAB engine functions (engPutVariable(), engEvalString(), engGetVariable(), etc.)
Image Analyst
Image Analyst 2013년 8월 18일
I'm not familiar with "the MATLAB engine". If you compiled some MATLAB code on your computer, then to access/run it on another computer, you'll need to install the MCR on that computer. If your code is talking to the full blown MATLAB development environment where MATLAB is acting as an ActiveX server, then you don't need to install the MCR.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

질문:

2013년 8월 18일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by