我正在尝试从模块关闭用户表单,但它不起作用。
这是我尝试过的
Sub UpdateSheetButton()
Dim subStr1 As String
Dim subSrrt2() As String
Dim tmp As Integer
Dim pos As Integer
Dim Form As WaitMessage
Set Form = New WaitMessage
With Form
.Message_wait = Module2.Label_PleaseWait
.Show
End With
For Each Cell In ActiveSheet.UsedRange.Cells
subStr1 = RemoveTextBetween(Cell.formula, "'C:\", "\AddIns\XL-EZ Addin.xla'!")
tmp = Len(subStr1) < 1
If tmp >= 0 Then
Cell.formula = subStr1
status = True
End If
Next
Unload Form
MsgBox Module2.Label_ProcessComplete
End Sub
表单名称为WaitMessage
。
我也尝试过 WaitMessage.Hide
但它也不起作用。
最佳答案
考虑无模式表单,在用户表单中创建一个子例程:
Sub UnloadThisForm ()
unload me
End Sub
并从用户窗体外部调用子程序;
call Userform1.UnloadThisForm
关于vba - 从模块关闭用户窗体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26887919/