Hi
I was wondering if it was possible to get the total distance between a route in Google maps without API and get it into excel with help of VBA?
Best regards
Martin
Hi
I was wondering if it was possible to get the total distance between a route in Google maps without API and get it into excel with help of VBA?
Best regards
Martin
Last edited by Vibov; 11-16-2020 at 05:11 AM. Reason: Solved
There is. You just need to pilot IE11 and read data off of that.
I did something similar years back, not for distance, but for geo-coordinate.
Base code sample:
Please Login or Register to view this content.
?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
― Robert A. Heinlein
Thanks CK76, but I believe this only are possible because the data are avaliable in the line for the webaddress and distance and time don´t seams to appear here but only at the webpage for google maps.
If you look at this string with multiple stops, then distance and time are not showed:
https://www.google.dk/maps/dir/Greve...41!2d55.580912
I´m beginning to thing google´s API now are the only solutions, unfortunal but thank you very much for your input :-)
It's still possible. You just have to construct URL request and scrape data off of HTML document.
Ex: Add reference to MS HTML object and MS Internet Controls in your project.
EDIT: Increase wait time as needed.Please Login or Register to view this content.
Commented out section is to export HTMLDocument.Body.innerHTML out to text file to inspect and identify element that hold the info desired.
See attached.
Thanks CK76 - But instead of Debug.print how do I get the information into a variable or in a specific cell of the workbook?
As an alternative, you can use Google Sheets to calculate the distance and duration between start and destination points.
https://docs.google.com/spreadsheets...it?usp=sharing
Thank you all. Solved
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks