When the switch is closed, the voltmeter measures the potential difference across the resistor or load in the circuit. However, when the switch is open, the voltmeter measures the potential difference across the open switch. This means that the voltmeter measures the open-circuit voltage of the battery, which is the voltage reading when the switch is open.