The problem is with
Set ie = CreateObject("InternetExplorer.Application")
Your question states that this works with Windows 11 but not with Windows 10 - I suspect you have that the wrong way around!
If you
Google[
^] for "internet explorer in Windows 11" you will find there are additional steps you must take to make the code work.
There is also this article which suggests a policy set up
I need code that ran in IE to work in Edge. - Microsoft Q&A[
^]
Given IE's demise and how the world moves on, it may be time to take a completely different approach than "web scraping" - see this article
How To Use Selenium with Excel in 4 Simple Steps - Excel VBA Is Fun[
^] or use Power Query -
Extract data from a Web page by example - Power Query | Microsoft Learn[
^]