Consulting

Results 1 to 9 of 9

Thread: Max characters allowed on status bar?

  1. #1
    VBAX Newbie
    Joined
    Sep 2018
    Posts
    5
    Location

    Max characters allowed on status bar?

    I have a workbook where I constantly display some information on the status bar, so the user can see it no matter what sheet they are currently looking at. Since I updated my Office 365 to the most current version the other day, I notice that the last two characters on my message on the status bar do not appear, but instead a '...' appears, as if to indicate my message is too long. Is there a maximum number of characters allowed to be displayed on the status bar now? If so, can it be changed via VBA code? I would really like the entire message to be displayed. There is still plenty of room on the status bar, so it seems silly that all of the characters would not be visible.

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    Cross-posted at: https://www.mrexcel.com/forum/excel-...tatur-bar.html
    Please read VBA Express' policy on Cross-Posting in item 3 of the rules: http://www.vbaexpress.com/forum/faq...._new_faq_item3
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    VBAX Newbie
    Joined
    Sep 2018
    Posts
    5
    Location
    Sorry, I did not realize it was against the rules to post the same question to a different forum, since I did not receive an answer to my post on the other forum. If I ever find myself needing to do it again, I will be sure to include a link to the first posting inside my question.

    I just asked the following question over at Mr. Excel, but if you do not have an account over there, I would like to ask if you could please respond to the following: have you ever experienced this issue before, and if so, what Excel are you using (2010, 2013, 2016, Windows, Mac, etc), and are you using the most up-to-date version of it? I am trying to pinpoint where this issue happens. Before I downloaded the most current updates to Office 365, I don't remember ever noticing it.

  4. #4
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,726
    Location
    Sorry, I did not realize it was against the rules to post the same question to a different forum, since I did not receive an answer to my post on the other forum. If I ever find myself needing to do it again, I will be sure to include a link to the first posting inside my question.
    Not against the rules, but we just like to know so that if you get an answer, we don't waste time unnecessarily



    The FAQ is in my sig

    http://www.vbaexpress.com/forum/faq...._new_faq_item3


    ExcelGuru has a very nice explanation of the issue (also a link in our FAQ)

    https://www.excelguru.ca/content.php?184
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  5. #5
    VBAX Newbie
    Joined
    Sep 2018
    Posts
    5
    Location
    I did not receive a reply to my post here, so I just posted about this issue on another forum. Link to that post can be found here:
    https://stackoverflow.com/questions/...mplete-message

  6. #6
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,726
    Location
    An option might be to scroll the text


    https://www.mrexcel.com/forum/excel-...s-bar-how.html

    Private Declare Sub Sleep Lib "kernel32" _ (ByVal dwMilliseconds As Long) Public Sub StatusbarAnimate() Dim sText As String Dim iLength As Integer Dim bForwards As Boolean sText = "Hello" iLength = Len(sText) + 1 bForwards = True rep = 0 Do DoEvents rep = rep + 1 If bForwards Then sText = " " & sText Else sText = Right(sText, Len(sText) - 1) End If If Len(sText) > 30 Then bForwards = False End If If Len(sText) < iLength Then bForwards = True End If Sleep 150 Application.StatusBar = sText If rep > 50 Then GoTo break Loop break: Application.StatusBar = "" sText = "Hello again" iLength = Len(sText) + 1 bForwards = True rep = 0 Do DoEvents rep = rep + 1 If bForwards Then sText = " " & sText Else sText = Right(sText, Len(sText) - 1) End If If Len(sText) > 30 Then bForwards = False End If If Len(sText) < iLength Then bForwards = True End If Sleep 150 Application.StatusBar = sText If rep > 50 Then GoTo break1 Loop break1: Application.StatusBar = "" End Sub
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  7. #7
    VBAX Newbie
    Joined
    Sep 2018
    Posts
    5
    Location
    Thanks for that, Paul. Interesting. I will take a look more closely at that idea.

    In the meantime, would you mind downloading my test file? I would love to hear if you report the same behavior that I mentioned in my post over at Stack Overflow. Also, would love to know what version of Excel you have. I'm trying to understand why this is happening, but have had no luck in figuring it out so far.

    My Stack Overflow message is here:
    https://stackoverflow.com/questions/...mplete-message

    My test file can be found here:
    https://www.dropbox.com/s/if8693weievd7vw/Test-StatusBarMessage.xlsm?dl=0



  8. #8
    VBAX Newbie
    Joined
    Sep 2018
    Posts
    5
    Location
    In case you are not wanting to download my file, here is the code that is in my file.

    In Sheet1 Module:
    Private Sub Worksheet_Change(ByVal Target As Range)
    
    Application.StatusBar = MessageToDisplay
    
    End Sub
    In ThisWorkbook Module:
    Private Sub Workbook_Open()
    
    Application.StatusBar = MessageToDisplay
    
    End Sub
    In Module1 Module:
    Function MessageToDisplay() As String
    
    Dim ValueCellA1 As String
    
    ValueCellA1 = ThisWorkbook.Sheets("Sheet1").Range("A1").Value
    
    MessageToDisplay = "This is a test to see how long of a message can be displayed on the status bar. I have noticed in Excel 2016 (most current version) that there seems to be a limit.  The value of Cell A1 is: " & ValueCellA1
    
    End Function

  9. #9
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,726
    Location
    I did test little differently also using 360

    This is at full screen I don't know what would happen if the window were half screen

    Max length is 256 characters, BUT if it's too long to display the status bar goes blank

    I did 256 dots and 256 M's. The Dots fit, the Ms did not


    Option Explicit
    
    
    'Api declaration for suspending operation for a specified time
    Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    
    Sub MakeLonger()
        Dim i As Long
        
        Application.StatusBar = "M"
        On Error GoTo Oops
        For i = 2 To 500
            Application.StatusBar = Application.StatusBar & "M"
            DoEvents
            Sleep 100
        Next i
    
        Exit Sub
    Oops:
        MsgBox i
    
    End Sub

    Dots.JPG

    M.JPG
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

Posting Permissions

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