1

Problem: Users on different machines unable to execute VBA macro that works perfectly on my machine and the machines of others.

Having issues with ActiveX form controls in MS Excel 2010 v.14.0.7015.1000 (32-bit). Using ActiveX Button and Text box I wrote VBA code that populates the text box when the button is clicked.

The code executes perfectly on my machine and has worked on other machines. I am having issues with other users being able to click the button. I told the user having trouble to try to run the Macro with the Alt+F8 keyboard command, but the user got an "object required" error.

Have hit a wall and I am looking for anything that might help.

Also tried this forum related to a MS update to no avail: Microsoft Excel ActiveX Controls Disabled?

Thanks in advance!

Attached is the code if helpful:

Public Sub CommandButton1_Click()


'Clear Working tab spreadsheet

    Worksheets("Sheet3").Range("A:AF").ClearContents

'-----------------

'Filter One Doc to correct process and requirement

'    Process

    Worksheets("One Doc Copy").Range("A2:AF12073").AutoFilter _
    Field:=4, _
    Criteria1:=Worksheets("MASTER TAB").Cells(2, ActiveCell.Column), _
    VisibleDropDown:=False

'    Requirement

    Worksheets("One Doc Copy").Range("A2:AF12073").AutoFilter _
    Field:=12, _
    Criteria1:=Worksheets("MASTER TAB").Cells(ActiveCell.Row, 2), _
    VisibleDropDown:=False

'-----------------

'Copy Filtered One Doc Data to Working Tab (Sheet3)

    Worksheets("One Doc Copy").Range("A2:AF12073").SpecialCells(xlCellTypeVisible).Copy _
    Destination:=Worksheets("Sheet3").Range("A3")

'-----------------

'Return the number of results for counter (find safer place for value)

    Dim Counter As Integer
    Counter = Worksheets("MASTER TAB").Range("DX3").Value

'-----------------

'Populate Text Box

Dim process, ctrlTxt As String
process = Worksheets("MASTER TAB").Cells(2, ActiveCell.Column)

If Counter = 0 Then

    TextBox1.Text = "There are no assigned requirements for: " & process

Else

    TextBox1.Text = "Controls for: " & process & vbLf & vbLf _
    & "Requirement #: " & Worksheets("sheet3").Range("L3").Value & vbLf _
    & "Requirement Description: " & Worksheets("sheet3").Range("M3").Value & vbLf _
    & "Total Number of Controls: " & Counter & vbLf _
    & "-----------------" & vbLf & vbLf

    For x = 0 To Counter - 1

        ctrlTxt = ctrlTxt & "(" & x + 1 & ")" & vbLf & vbLf _
                    & "Control Type: " & Worksheets("sheet3").Cells(3 + x, 19) & vbLf & vbLf _
                    & "Control Description: " & vbLf & vbLf & Worksheets("sheet3").Cells(3 + x, 20) & vbLf & vbLf _
                    & "---" & vbLf

    Next

    TextBox1.Text = TextBox1.Text + ctrlTxt

End If

End Sub
Community
  • 1
  • 1
Robert Z
  • 11
  • 2
  • Have you applied the MS updates and run the fixit tool on all the machines in question? If not, you can't share the workbook and use ActiveX controls. – Rory Feb 26 '15 at 15:51
  • Could you please show the complete detail for the "object required" message? – Christopher Bottoms Feb 26 '15 at 15:52
  • Hi Rory, that's a good point I will give that a go. – Robert Z Feb 26 '15 at 20:42
  • Hi Christopher, I don't have an image available because that person's computer is not readily available. However, the only text that was mentioned was "Object Required." I found this curious because I have received Run time error 424 "Object Required" before, but did not get a specific error number this time. – Robert Z Feb 26 '15 at 20:44

0 Answers0