+ Reply to Thread
Results 1 to 14 of 14

Pickup time from Internet servers

  1. #1
    Forum Contributor
    Join Date
    06-12-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    153

    Pickup time from Internet servers

    Hi all,

    Kindly refer to the attachment.

    Column C has a list of city names.. Is there a way we can pull the current time from any website or internet server.
    If not only the time zone they fall under

  2. #2
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Pickup time from Internet servers

    You're looking for something like the code below, I suspect.
    Set references to Microsoft XML and Microsoft HTML

    Please Login or Register  to view this content.
    Please click the * below if this helps
    Last edited by JasperD; 04-05-2015 at 06:25 AM. Reason: Forgot to implement the replace for spaces in countries
    Please click the * below if this helps

  3. #3
    Forum Contributor
    Join Date
    06-12-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    153

    Re: Pickup time from Internet servers

    Hi Jasper.. thanks for the help..

    I did try running the code .. but it gave me an compile error message.

    Attached screenshot.. Kindly assist
    Attached Images Attached Images

  4. #4
    Forum Contributor
    Join Date
    06-12-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    153

    Re: Pickup time from Internet servers

    it was the reference.. i was able to run it... checkin it now

  5. #5
    Forum Contributor
    Join Date
    06-12-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    153

    Re: Pickup time from Internet servers

    ATTACHED output of the VBA.... we almos there...

    the D column is giving us result in non english, also, can we not just search with the City name if that helps for more results

    Kindly advise

  6. #6
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Pickup time from Internet servers

    You can't search with just city name.
    The result will always be in your system language, since that's how the website presents it.

    If you find another site that gives the result in English and is flexibile enough to search for the city AND find what you need, then feel free to let me know.
    But be careful with just looking for city, because if you'd look for "London", you'd get 4 hits in 3 different countries.

  7. #7
    Forum Contributor
    Join Date
    06-12-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    153

    Re: Pickup time from Internet servers

    I agree to your feedback...

    Can we try http://www.thetimenow.com/

  8. #8
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Pickup time from Internet servers

    That site poses the exact same problems as the one I used.
    I don't really feel the necessity to change it around, but feel free to adjust the code to your liking.

    As long as you don't type the country / state / city names exactly as expected by the site, you'll always going to get misses.

  9. #9
    Forum Contributor
    Join Date
    06-12-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    153

    Re: Pickup time from Internet servers

    Okay...
    Jasper, just wanted to get this clarified further.. When i execute this code.. I get unknown address for almost 40 city's.. But when I search for them in the website.. It works absolutely fine.. Are we missing anything here..

    Please advise..

  10. #10
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Pickup time from Internet servers

    Try

    Please Login or Register  to view this content.
    Please click the * below if this helps

  11. #11
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Pickup time from Internet servers

    This won't find the time for:

    "Oakville, Canada" = Doesn't exist on the site
    "Beyazit-Istanb" = "Istanbul"
    "Sharm el Sheik" = "Sharm ash Shaykh"
    "Moscow, Russian Federation" = "Moscow, Russia"
    "Victoria - Mah, Seychelles" = "Victoria, Seychelles"
    "Bangalore - India" = Doesn't exist on the site
    "Enfield, Canada" = Doesn't exist on the site

    etc.

  12. #12
    Forum Contributor
    Join Date
    06-12-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    153

    Re: Pickup time from Internet servers

    this works absolutely fine.. Just that after few min when I exceute same code again, it does not update. It gives the same result of the first execute

    I have to relaunch excel file and run the code again to get an updated time

  13. #13
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Pickup time from Internet servers

    Gotta love Internet cache :-)
    Try

    Please Login or Register  to view this content.

    Typing from phone, so untested
    Last edited by JasperD; 04-06-2015 at 11:15 AM. Reason: Tested it and included cell.activate to show where you are...

  14. #14
    Forum Contributor
    Join Date
    06-12-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    153

    Re: Pickup time from Internet servers

    supe supee.. double cheerz to u... thanks a lot... that work perfect

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Real time spell check using internet in excel
    By drsantosh in forum Excel General
    Replies: 2
    Last Post: 08-20-2014, 11:53 AM
  2. Excel 2007 : Connecting to 2 SQL servers
    By blstrahan044 in forum Excel General
    Replies: 0
    Last Post: 06-23-2011, 09:35 AM
  3. [SOLVED] use shared workbooks on Web servers
    By Gkrish in forum Excel General
    Replies: 1
    Last Post: 01-22-2005, 06:06 PM
  4. [SOLVED] Where're the good newgroups servers?
    By Nystas in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 01-19-2005, 09:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1