小编VBA*_*Jam的帖子

运行时错误 424 Object Required UserForm 不存在

我正在尝试执行本网站www.excel-easy.com上写的内容,但是当我commandbutton按照网站指示单击工作表中的(来自 ActiveX 控件)时,没有任何反应。我尝试使用表单控件中的按钮,但它说错误在此 ---> DinnerPlannerUserForm.Show

我的代码:

Sub Button2_Click()
    DinnerPlannerUserForm.Show
End Sub
Run Code Online (Sandbox Code Playgroud)

当我使用 F8 时,它说错误在这里 --> Private Sub UserForm_Initialize()

Private Sub UserForm_Initialize()

    'Empty NameTextBox
    NameTextBox.Value = ""

    'Empty PhoneTextBox
    PhoneTextBox.Value = ""

    'Empty CityListBox
    CityListBox.Clear

    'Fill CityListBox
    With CityListBox
        .AddItem "San Francisco"
        .AddItem "Oakland"
        .AddItem "Richmond"
    End With

    'Empty DinnerComboBox
    DinnerComboBox.Clear

    'Fill DinnerComboBox
    With DinnerComboBox
        .AddItem "Italian"
        .AddItem "Chinese"
        .AddItem "Frites and Meat"
    End With

    'Uncheck DataCheckBoxes
    DateCheckBox1.Value = False
    DateCheckBox2.Value = False
    DateCheckBox3.Value = False

    'Set …
Run Code Online (Sandbox Code Playgroud)

excel vba

6
推荐指数
2
解决办法
3万
查看次数

标签 统计

excel ×1

vba ×1