作者:Lyceenne | 来源:互联网 | 2023-05-19 12:05
IamtryingtocreateaPleaseWaitmessageinExcel-VBA.Thisistoremindtheuserprocessingasq
I am trying to create a Please Wait
message in Excel-VBA. This is to remind the user processing a sql query that the process is still ongoing.
我正在尝试在Excel-VBA中创建一个请等待消息。这是为了提醒处理sql查询的用户该过程仍在进行。
I would like to have this message displayed in a userform.
我希望这个消息以userform显示。
Currently, the user connects to sql db, selects db and some other options, presses Go... and the form does not unload. At the Go point i have another form which pops up with message Please Wait
, but this form does not unload, i.e. the sql execute command does not run.
目前,用户连接到sql db,选择db和其他一些选项,按Go…并且表单没有卸载。在Go point,我有另一个弹出消息的表单,请等待,但是这个表单不卸载,即sql execute命令不运行。
My code for calling the Please Wait
userform, including a label:
我调用请等待用户表单的代码,包括一个标签:
Call WaitShowSQl.ExecuteCall KillWaitCall WaitShow
SQl.Execute
Call KillWait
In another code module I have:
在另一个代码模块中:
Sub WaitShow()
Wait.Show
End Sub
Sub KillWait()
Unload Wait
End Sub
I have userform called wait
with following code:
我有一个叫wait的userform,代码如下:
Private Sub UserForm_Activate()
Call PleaseWait
End Sub
Sub PleaseWait()
Wait.Label1.Caption = "Calculating...Please Wait!"
End Sub
Now when executing the code, the run-time does not move back through the module in order to execute the following:
现在,在执行代码时,运行时不会通过模块返回来执行以下操作:
SQl.ExecuteSQl.Execute
I can show the progress of the program with a status bar, but a userform pop up message would be very useful for this program.
我可以使用状态栏显示程序的进度,但是userform弹出消息对这个程序非常有用。
4 个解决方案