Consulting

Results 1 to 3 of 3

Thread: Form not accepting change in width

  1. #1
    VBAX Regular
    Joined
    Oct 2015
    Posts
    17
    Location

    Form not accepting change in width

    I have a ribbon I created in a template and there's one icon that performs the following function:
    Sub cAddIndex(control As IRibbonControl)
        VTAlt_I
    End Sub
    This VTAlt_I function will be called and will run the following code:
        
    Sub VTAlt_I()
      Dim rRes As Boolean
    
        If satt1 = "" And satt2 = "" And satt3 = "" And satt4 = "" And satt5 = "" And satt6 = "" And  satt7 = "" And satt8 = "" And _
            satt9 = "" And satt10 = "" And satt11 = "" And satt12 = "" Then
        
                MsgBox "Please use the Alt+E macro to populate lawyer names", vbOKOnly, "No colloquy names assigned"
        
        ElseIf CheckParties = True Then
                frmIndex.Show
        End If
    End Sub

    VTAlt_I is also attached to a keyboard shortcut Alt+I, which runs this same function, VTAlt_I.


    Now the next part is where it gets strange. When this particular user clicks on the icon from the ribbon everything runs fine. When they use the shortcut key Alt+I it opens up the form but the width is all messed up.


    So the problem lies within the Initialize procedure of frmIndex. I've stripped out all the other code and narrowed it down to this line:


    Me.Height = 483
    Me.Width = 340

    The height will lock in at 483, but when it goes to change the width to 340, for whatever reason it gets set to 518. Hundreds of other users use the same template and run the same macro, including myself and don't experience this at all. I'm at a loss as to why it works with the ribbon icon but not the shortcut key when they both execute the exact same code. Any insight would be appreciated. If anything needs to be cleared up happy to do so.
    Last edited by SamT; 06-01-2018 at 01:49 PM.

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    Since "Hundreds of other users use the same template and run the same macro, including myself and don't experience this at all", that suggests the errant one has a faulty Office installation. Try repairing that PC's Office installation (via Windows Control Panel > Programs > Programs & Features > Microsoft Office (version) > Change > Repair).
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Hundreds of other users use the same template and run the same macro, including myself and don't experience this at all.
    Then there is no problem with the code. Look at the ONE computer that has a problem.

    Edit: Oops, Paul beat me to it.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

Posting Permissions

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