Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Server time (VBA/Excel/2003)

    My machine has access to several servers.These servers do NOT have their clocks synchronized. Is there any VBA technique to determine the time discrepancy between Server "A" and my machine?

    Have you ever been missed!
    Regards
    Don

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Server time (VBA/Excel/2003)

    The code from API: Retrieve NT Server's Time can be used to get the server time (as a string).
    Note: the article mentions that it works only on Windows NT, but since Windows 2000, XP, 2003 and Vista are based on NT, it should work there too.

  3. #3
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Server time (VBA/Excel/2003)

    Don

    Not VBA but something you could introduce as a maintenance routine and that is

    Using NET TIME for all Workstations and Servers
    Jerry

  4. #4
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Server time (VBA/Excel/2003)

    I didn't mention that in one instance, I'm using an old clunker (Win 98) to emulate a server. I have developed a procedure (attached), to capture the time from it. Perhaps others will find it useful.

    Note

    1. <LI>The results will be in error by the access time to the server; and
      <LI>The server must be mapped
    Attached Files Attached Files
    Regards
    Don

  5. #5
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Server time (VBA/Excel/2003)

    Thanks Jerry
    Regards
    Don

Posting Permissions

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