Changed to a common method

Both newSpreadSheet() and loadSpreadSheet() shared this implementation.