在没有百分比更新的用户窗体上显示进度
我想在我的程序正在做所有事情的时候显示进度,知道它正在工作而不是失败。 问题是,我没有使用任何索引, For...Next
, While
,或者任何我可以用来调用我的进度栏更新。
该程序:
- 打开2本书
- 将一堆行从一个复制到另一个
- 刷新其他许多表单中的所有数据/graphics。
由于我没有遍历所有行(这是我进度条的主要参考点)的循环,我不知道如何显示进度。
对不起,如果我不能更具体,但我不知道如果我可以分享任何代码。 如果你需要更多的信息,我可以尝试在这里张贴一些。
我的进度条代码是:
Public Sub UpdateProgressBar(PctDone As Single) With ProgressForm ' Update the Caption property of the Frame control. .FrameProgress.Caption = Format(PctDone, "0%") ' Widen the Label control. .LabelProgress.Width = PctDone * (.FrameProgress.Width - 10) End With ' The DoEvents allows the UserForm to update. DoEvents End Sub Public Sub UpdateProgressText(txt) ProgressText.Caption = txt End Sub