Rifat Hassan wrote a fantastic article which can be found about VBA about pulling data automatically from a website. His article can be read here: https://www.exceldemy.com/pull-data...491ac2937a6bea6506c49803c7e648#comment-329555
I realize that I am an old timer here, but I am still using Windows 7 Professional and Excel 2007 (release 12.0) which works perfectly in the examples Rifat gave in his article. Unfortunately the website that I need to pull data from is Google Maps and it requires a browser newer than Internet Explorer which is what Rifat used in his article.
I have installed Edge, which Google Maps claims to support.
I found code at: https://learn.microsoft.com/en-us/answers/questions/829365/vba-automation-with-edge-ie-mode under the subject heading "VBA automation with Edge IE mode" which suggests that this Edge in IE mode will solve the problem, but I do not know for certain if that is the case because I am unable to get past a declaration statement that reads:
Private Declare Ptrsafe Function EnumWindows Lib "user32" ( _
ByVal lpEnumFunc As LongPtr, _
ByVal lParam As Long) _
As Long
The VBA compiler has issue with this statement, turning it red, but if I remove the Ptrsafe, then that problem goes away. From what I read, that will only effect backward compatibility which is not an issue for me.
Then, when I run the code, I am confronted with the following message: Compile Error Message: "User-defined type not defined." I believe that this has to do with the 'user32' phrase -- presumably the compiler is looking to link in lib "user32" in which it expects to find the function EnumWindows -- and it cannot find the library. I have researched this heavily, and cannot with certainty determine if my version of VBA has "user32" library; whether this library exists but I don't have it linked in correctly; or some other issue is at play here. In the course I my reading it has been suggested in various forums (in answer to other questions) that the correct token is user32.lib, user32.dll, vba.user32, vba.user.lib, and vba.user32.dll and I have tried them all.
At this point I am open to any suggestions other than upgrading my entire environment which will cause greater headaches; that is to say, I am open to other methods to grab the data I need which I seems to only reliably exist on Google maps.
I realize that I am an old timer here, but I am still using Windows 7 Professional and Excel 2007 (release 12.0) which works perfectly in the examples Rifat gave in his article. Unfortunately the website that I need to pull data from is Google Maps and it requires a browser newer than Internet Explorer which is what Rifat used in his article.
I have installed Edge, which Google Maps claims to support.
I found code at: https://learn.microsoft.com/en-us/answers/questions/829365/vba-automation-with-edge-ie-mode under the subject heading "VBA automation with Edge IE mode" which suggests that this Edge in IE mode will solve the problem, but I do not know for certain if that is the case because I am unable to get past a declaration statement that reads:
Private Declare Ptrsafe Function EnumWindows Lib "user32" ( _
ByVal lpEnumFunc As LongPtr, _
ByVal lParam As Long) _
As Long
The VBA compiler has issue with this statement, turning it red, but if I remove the Ptrsafe, then that problem goes away. From what I read, that will only effect backward compatibility which is not an issue for me.
Then, when I run the code, I am confronted with the following message: Compile Error Message: "User-defined type not defined." I believe that this has to do with the 'user32' phrase -- presumably the compiler is looking to link in lib "user32" in which it expects to find the function EnumWindows -- and it cannot find the library. I have researched this heavily, and cannot with certainty determine if my version of VBA has "user32" library; whether this library exists but I don't have it linked in correctly; or some other issue is at play here. In the course I my reading it has been suggested in various forums (in answer to other questions) that the correct token is user32.lib, user32.dll, vba.user32, vba.user.lib, and vba.user32.dll and I have tried them all.
At this point I am open to any suggestions other than upgrading my entire environment which will cause greater headaches; that is to say, I am open to other methods to grab the data I need which I seems to only reliably exist on Google maps.