none
[Solved] How to change Textbox width on the Ribbon if Excel Version? RRS feed

  • Question

  • Hello experts.
    Can I resize the textbox on the ribbon tab while loading my addin? I used the test method excel version will change corresponding to the textbox width
    I wrote this code but it didn't work maybe because I didn't properly reference its ribbon1 variable.

    Public Class ThisAddIn

        Private Sub ThisAddIn_Startup() Handles Me.Startup
            Dim rib_1 As Global.myaddin.Ribbon1 = Ribbon1


            If Determine_OfficeVersion_2() = "Old" Then
                rib_1.AU_G2TxtFormat.SizeString = "xXXXXX-"
            Else rib_1.AU_G2TxtFormat.SizeString = "xXXXXXX"
            End If
        End Sub

        Private Sub ThisAddIn_Shutdown() Handles Me.Shutdown

        End Sub

    End Class

    Thanks everyone!



    • Edited by Khanh01 Wednesday, August 28, 2019 6:46 PM
    Wednesday, August 28, 2019 6:18 PM

All replies

  • When designing the addin, I noticed that the alignment of the box was changed for different versions. I found a solution for it called method from ribbon.design.vb and it worked
    If there is a new question I will come back
    thanks social! 


    • Edited by Khanh01 Wednesday, August 28, 2019 6:46 PM
    Wednesday, August 28, 2019 6:46 PM