PDA

View Full Version : [SOLVED:] Form not accepting change in width



xSmityx
05-31-2018, 01:22 PM
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.

macropod
05-31-2018, 05:39 PM
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).

SamT
06-01-2018, 01:52 PM
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.