Error in xlsReadSA; code from Stock and Watson (2005)


I am a beginner in using Gauss. I want to run the original code from Stock and Watson (2005) "Implications of dynamic factor models for VAR analysis", which can be downloaded from Mark W. Watson's homepage ( I changed all the directories inside the code so that they match my Gauss working directory, but unfortunately I always get the error "Error in xlsReadSA: Could not load file C:\Users\...\sims\ddisk\data\sims.xls", for example when I run the programm "favar_variance_decomp.gss". Did I set one directory wrong? As I said, I am very new to Gauss. Thank you very much for your help!

1 Answer


Welcome to the GAUSS user forum!

Most likely the problem is one of two possibilities:

  1. You are running this code on a Windows computer on which Excel is not installed.
    If this is the case, and you are running GAUSS version 13.1 or newer, you can follow the instructions from this post to resolve your problem.
  2. The Excel file is in a different directory than you are telling GAUSS.

    Based on your explanation I think you are saying that you set your GAUSS working directory to be the directory in which sims.xls is located and that you have a statement to load the data in your code that looks something like this:

    x = spreadSheetReadM("sims.xls", "A1", 1);

    We can use the GAUSS command filesa to return to us a list of files in the GAUSS current working directory which have a file extension of .xls, like this:

    //Print out the names of all files which
    //end with either .xls, .xlsx, .xls....

    Run that command from the GAUSS command prompt. If filesa returns sims.xls as one of the found files, AND your code to read the Excel file looks like the one above, then this is not your problem.

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.

Try GAUSS for 14 days for FREE

See what GAUSS can do for your data

© Aptech Systems, Inc. All rights reserved.

Privacy Policy