When a vacancy occurs and before the election or appointment and qualification of a successor, possession shall be taken of all things pertaining to the office and the functions of the office shall be exercised as follows:
(1) Of any of the county offices, by the deputy if there is one and, if not, by a replacement appointed by the county board to perform the functions of the office until a permanent successor is duly appointed or elected; and
(2) Of any of the state offices, by the Governor or, in his or her absence or inability at the time of the occurrence, as follows:
(a) Of the Secretary of State by the State Treasurer;
(b) Of the Auditor of Public Accounts by the Secretary of State; and
(c) Of the State Treasurer by the Secretary of State or Auditor of Public Accounts.
The officer performing the functions of the State Treasurer shall make and sign an inventory of the money and warrants in the care of the office and transmit it to the Governor if he or she is in the state, and the Secretary of State shall take the keys of the safes and desks after depositing the books, papers, money, and warrants in such safes and desks and shall keep the key to the office.