Error when trying to export matrix to excel: Could not access specified range in file

I am using Gauss 14 and attempting to export a large matrix to excel using the following:

vls = reshape(error(0),9,1);

ret = xlsWrite(results, "a.xlsx", "A1", 1, vls);

where results is a matrix approximately 570000x6. I keep getting the error message "Could not access specified range in file: a.xlsx" Could someone please tell me how to fix this problem? Thanks

3 Answers


It may be that the standard COM interface between GAUSS and Excel on Windows cannot handle 570,000 rows. GAUSS 13 and newer also comes with the capability to read and write XLS and XLSX files directly. This method can write that many rows.

To turn off the COM interface and have GAUSS read and write XLS/XLSX files directly you need to comment out three lines inside of your xls.src file. You can open this file by entering:

edit xls.src;

from the GAUSS command prompt. GAUSS will know which directory to look in. You need to comment out these lines:

   #define USECOMEXCEL 1

so that they look like this:

Then run your xls.src file, by entering:

run xls.src;

from the GAUSS command line. Then you should be able to read and write any size file that the XLS or XlSX format can handle.


Thank you for the response. After doing that, I now get the input message "Incorrect input: range too large." Thoughts?


I have it working now. I think your hypothesis about the matrix being too large was correct. Thank you for the help.

You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.


Thank you for your interest in the GAUSS family of products.

© Aptech Systems, Inc. All rights reserved.

Privacy Policy | Sitemap