The budget was in surplus at the end of the 2014/15 fiscal year, which ended March 31st, 2015.  The Federal government sold their shares in GM in April of 2015 so that sales was booked as part of the 2015/16 fiscal year.

So the budget was balanced as of the last FULL year that Harper and the Conservatives were in sales WITHOUT any effects from the GM share sales.

Since Harper left office halfway through the 2015/16 fiscal year it is difficult to say whether the budget was balanced at the end of his tenure, with or without the GM share sales.  At the end of the 2015/16 fiscal year the government had a $1.0B deficit and the GM share sale added $2.1B in one-time revenue, so without the share sales we had a $3.1B hole.

However total program spending for the fiscal year was $7.6B higher than budgeted.  A substantial portion of that new spending was due to changes made after the Liberals took office in Nov. 2015.