[VBA]新手求助:这个错误如何处理?
<P>学习使用VBA处理控件数组过程中,对VBA提供的样例代码的编译中出现“无效的类别字符串”不知道该如何处理,请版主帮助。</P>C:\Documents and Settings\Administrator\My Documents\My Pictures\未命名.bmp 代码都没有,神仙啊。 致<A name=6876><FONT color=#990000><B>mccad</B></FONT></A>:除了被遮盖住的commandbutton的caption属性外,代码全部在图中了。 <P>图看不见,把你的代码直接贴上吧</P> <PRE class=CT><CODE>Dim MyTextBox As Control</CODE></PRE><PRE class=CT><CODE>Private Sub CommandButton1_Click()<BR> Set MyTextBox = MultiPage1.Pages(0).Controls.Add("MSForms" & ".TextBox.1", "MyTextBox", Visible)</CODE></PRE><PRE class=CT><CODE>End Sub</CODE></PRE><PRE class=CT><CODE></CODE><CODE>Private Sub CommandButton2_Click()<BR> MultiPage1.Pages(0).Controls.Clear<BR>End Sub</CODE></PRE><PRE class=CT><CODE>Private Sub CommandButton3_Click()<BR> If MultiPage1.Pages(0).Controls.Count > 0 Then<BR> MultiPage1.Pages(0).Controls.Remove "MyTextBox"<BR> End If<BR>End Sub</CODE></PRE><PRE class=CT><CODE>Private Sub UserForm_Initialize()<BR> CommandButton1.Caption = "Add control"<BR> CommandButton2.Caption = "Clear controls"<BR> CommandButton3.Caption = "Remove control"<BR>End Sub<BR></CODE></PRE><PRE class=CT><CODE>在黑体下划线行提示“运行时错误'2147221005(800401f3)':无效的类别字符串”,不知该如何处理?请版主帮助。</PRE></CODE>
页:
[1]