After the latest Windows 11 update (23H2), the listed function generates an EOleException clas error.