If from any cause the official ballots have not been received at a polling place on the morning of a primary or election and before the opening of the polls, or if the supply of ballots shall become exhausted during the process of balloting and before the polls are closed, the board of elections concerned shall cause unofficial ballots to be prepared, substantially, as far as may be, in form of the official ballots, and upon receipt of such unofficial ballots from the board, accompanied by a statement of its chairman or vice-chairman under oath that the unofficial ballots have been so prepared and that the official ballots have not been received, or that the supply has been exhausted, the election officers at such polling place shall cause the unofficial ballots so substituted to be used in lieu of the official ballots, in order that no elector shall be deprived of the right to vote for the lack of a ballot.