Error Creating Excel Summary in Staircase Procedure

Hi all, I’ve been stuck on this issue for a few days now. I’m sure the answer is probably something obvious but I can’t quite figure out what I’m doing wrong!

OS: Mac10.14.3
PsychoPy version: 3.0.6
**Standard Standalone?: yes
What are you trying to achieve?: I am trying to run a staircase procedure where a summary excel file is produced containing the reversal points.

What did you try to make it work?:
I have created my own staircase procedure experiment in Builder which produces an error after the staircase has terminated. To check it wasn’t due to the way I had built the experiment I downloaded and ran the staircase procedure experiment included in the demo pack. I have also tried using different versions of Psychopy bot (Psychopy 2 and Psychopy 3). All of these things have produced the same error each time (see below).

What specifically went wrong when you tried that?:
The staircase procedure runs as expected. Once the staircase terminates it is able to save the trial-by-trial csv file, log file and psydat file. However, it produces an error when trying to save the excel summary file:

Traceback (most recent call last):
  File "/Users/lpxhb4/Desktop/PsychoPy3 Demos/psychophysicsStaircase/", line 302, in <module>
    trials.saveAsExcel(filename + '.xlsx', sheetName='trials')
  File "/Applications/", line 639, in saveAsExcel
    ws.cell(column=startingCol, row=1,
NameError: name 'startingCol' is not defined

Hi, old post but I encountered the same problem. I solved it by adding the following line to before line 639:

            startingCol = 1


This problem has not been fixed so far.
One way to cope with it is to modify the line of saveAsExcel in Coder:
trials.saveAsExcel(filename + '.xlsx', sheetName='trials', matrixOnly=True)
but this is a bit of work for beginners. It’s actually a problem right now for me in teaching.

I hope this problem should be fixed at some point, but for the moment it would be nice if the matrixOnly option be set as True by default.