+ Reply to Thread
Results 1 to 7 of 7

Display System Time on Ribbon?

  1. #1
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Cool Display System Time on Ribbon?

    Just a spot of whimsy. Would it be possible to display the current time on the ribbon thus creating a mini clock in Excel? Either on a custom tab or on the Add-Ins tab. (I intend to implement it into a XLAM)

    If it can't be updated in real time then would it be possible to automatically refresh it every 60 seconds? (I am only interested in HH:MM so refreshing once a minute would be all I need).

    If this concept is entirely impossible then I would like to understand WHY it can not be done.

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Display System Time on Ribbon?

    it's possible, if pointless. you need a callback to update the text of the control to the current time and either application.ontime or a windows api timer to invalidate the control (or the whole ribbon)
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Display System Time on Ribbon?

    Quote Originally Posted by JosephP View Post
    it's possible, if pointless.
    Agree that it is pointless. Which is why I am describing it as whimsical. I just thought it would look cool if you had an inbuilt clock running on your ribbon. (It could be of some use if running Excel full screen?)

    Supposing I want it to appear on the Add-Ins tab (I am leaving the custom tab for later), where would I start?

    Please Login or Register  to view this content.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Display System Time on Ribbon?

    you'd need to add a control to a commandbar and set its text. then use application.ontime to schedule a routine for say 1 second delay that updates the text and then reschedules itself. don't forget to cancel the routine when closing the workbook or it will keep opening up again. if you're not familiar with ontime read up on it at Chip Pearson's site

  5. #5
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Display System Time on Ribbon?

    Quote Originally Posted by JosephP View Post
    you'd need to add a control to a commandbar and set its text. then use application.ontime to schedule a routine for say 1 second delay that updates the text and then reschedules itself. don't forget to cancel the routine when closing the workbook or it will keep opening up again. if you're not familiar with ontime read up on it at Chip Pearson's site
    Thanks for the help. I will try it out sometime.
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Display System Time on Ribbon?

    Hello mc84excel,

    FYI, in Excel 2007 and later, there is no "CommandBar" object. This was used to access the Menu in previous versions. The Ribbon is an entirely different object class. Changing the Ribbon requires using an XML script file.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  7. #7
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Display System Time on Ribbon?

    Quote Originally Posted by Leith Ross View Post
    Hello mc84excel,

    FYI, in Excel 2007 and later, there is no "CommandBar" object. This was used to access the Menu in previous versions. The Ribbon is an entirely different object class. Changing the Ribbon requires using an XML script file.
    Thank you however I am aware of both these points:
    • The "CommandBar" object does "work" in Excel 2007 & later albeit as the Add-Ins tab. Try it to see what I mean.
    • I am aware of the XML script as I have worked with Ribbons before.
    See: http://www.excelforum.com/excel-prog...ibbon-tab.html
    Last edited by Leith Ross; 02-03-2013 at 08:05 PM. Reason: Added URL

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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