MS Excel 2007 VBA" UserForm.Show"错误424

时间:2015-12-07 15:12:37

标签: excel vba excel-vba userform

Microsoft Excel 2007 VBA问题。我已经完成了一些挖掘工作,到目前为止我找到的答案都没有工作(删除.EXD文件),或者我正在努力理解解决方案(比如重新注册DLL文件。我不是&# 39;理解它是如何工作的,我不想破坏我的工作电脑。愿意学习是否有人可以解释它。)到目前为止我找到的解决方案是:

此处[Microsoft Excel ActiveX Controls Disabled?

和此处[Run Time Error 424 Object Required- VBA Start Stop

无论如何,我有一个带有此代码的按钮:

Sub CommandButton1_Click()
ValveDesignInputForm.Show
End Sub

我使用下面的代码创建了表单(我是VBA的新手,所以我不知道这里是否有错误。我为自己量身定制了一个教程。):

Sub CancelButton_Click()
Unload Me
End Sub

Sub ClearButton_Click()
Call UserForm_Initialize
End Sub

Sub RunButton_Click()
'Run the DesignCalculations Subroutine here
'Code below is to Test Form
Sheet1.Activate
emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1
Cells(emptyRow, 1).Value = ValveMaterialTextbox.Value
End Sub

Sub UserForm_Initialize()
'Empty Textboxes 
BoltDiameterTextbox.Value = ""
BoltMaterialTextbox.Value = ""
FigureNumberTextbox.Value = ""
GasketIDTextbox.Value = ""
GasketODTextbox.Value = ""
InletOutletTextbox.Value = ""
MinWallTextbox.Value = ""
NumberBoltsTextbox.Value = ""
PortDiameterTextbox.Value = ""
StemDiameterTextbox.Value = ""
StemEarHeightTextbox.Value = ""
StemEarWidthTextbox.Value = ""
StemThreadLeadTextbox.Value = ""
StemThreadPitchTextbox.Value = ""
ThreadsperInchTextbox.Value = ""
ValveMaterialTextbox.Value = ""
WedgeEarHeightTextbox.Value = ""
WedgeEarWidthTextbox.Value = ""
YokeArmLegAreaTextbox.Value = ""
'Empty Comboxes
GasketMaterialCombobox.Clear
MinWallThickB1634Combobox.Clear
PressureClassComboBox.Clear
ValveSizeCombobox.Clear
'Fill ComboBoxes for testing
With GasketMaterialCombobox
   .AddItem "Test"
End With
With MinWallThickB1634Combobox
   .AddItem "Test"
End With
With PressureClassComboBox
   .AddItem "Test"
End With
With ValveSizeCombobox
   .AddItem "Test"
End With
'Set English as Default Units
UnitsOptionButtonEnglish.Value = True
'Set Focus on ValveSize
ValveSizeCombobox.SetFocus
End Sub

我收到与第二个链接相同的错误。 "运行时错误424:对象必需",并且识别的编码错误是行 ValveDesignInputForm.Show 。是否有用户(非管理员)可以实施的经过验证的解决方案?如果没有,管理员的解决方案是什么? (我与之合作的IT技术人员对VBA并不熟悉。)非常感谢任何和所有帮助。

0 个答案:

没有答案