Error in runnung toolbox


Dear Prof. Pfeifer,

I am trying to run a toolbox for estimating VAR models: the BEAR toolbox. Having read the manual, I am to run bear_4_2.m. Also, in the first window that comes up after running the file, I am to add the path of the excel file to be run, data.xlsx, under ‘Set path to data’. However, after these two steps, I am getting the following error messages:

Error using copyfile
cp: /Users/SEYI/Downloads/toolbox 4.2/files\results.xlsx: No such file or directory

Error in initexcel (line 7)

Error in bear_toolbox_main_code (line 109)

Error in run (line 96)
evalin(‘caller’, [script ‘;’]);

Error in bear_4_2 (line 33)
run files/bear_toolbox_main_code;

I tried adding the Matlab path and the path of the toolbox in bear_4_2.m, but this made no difference. The toolbox is too large to attach. Please download it via the following link:

I would be really grateful for your help. Many thanks.


Is it true that you are using a Linux like operating system? The backslash near the end of

cp: /Users/SEYI/Downloads/toolbox 4.2/files\results.xlsx

seems to indicate a problem with Linux compatibility.
You should write to the authors of the BEAR toolbox.


Dear Prof. Juillard,

Many thanks for your prompt reply. I am using a Mac OS X operating system. That suggests it may work on a Windows PC, so I’ll try that. Thanks.


If you want to make the toolbox work on a Mac, it can be done. Just change the \ backslashes to / wherever they give an error.
For the Excel compatibility, you can use the Matlab user function ‘xlwrite’:

It circumvents the use of Excel by using the Apache POI java library. The only additional fix needed is changing all appearances of ‘xlswrite’ to ‘xlwrite’ in the code files of the Bear toolbox. You can do this systematically or just run the toolbox several times and trace the error to the file that produces it.


Thanks a lot for the reply!


Could you please tell me if have you used the toolbox on Mac? if yes, have you had other problems? Thanks a lot. I have the same your errors.


Sorry, I haven’t. I hope someone can help with your problem.


@DLT What exact error are you facing?