我想知道是否有人可以帮助我。
我正在使用以下“提取”代码,该代码在单击按钮时运行,并且还初始化一个带有滚动进度条的“Splash”表单,正如您可能看到的那样。
我正在使用以下“提取”代码,该代码在单击按钮时运行,并且还初始化一个带有滚动进度条的“Splash”表单,正如您可能看到的那样。
Private Sub btnFetchFiles_Click()
Dim j As Integer
'Display the splash form non-modally.
Set frm = New frmSplash
frm.TaskDone = False
frm.prgStatus.Value = 0
' frm.Show False
For j = 1 To 1000
DoEvents
Next j
iRow = 20
fPath = "\\c\s\CAF1\Dragon Mentor Group\Dragon Scripts\Current\April 2015"
If fPath <> "" Then
Set FSO = New Scripting.FileSystemObject
frm.prgStatus.Value = 10
If FSO.FolderExists(fPath) <> False Then
frm.prgStatus.Value = 20
Set SourceFolder = FSO.GetFolder(fPath)
IsSubFolder = True
frm.prgStatus.Value = 30
Call DeleteRows
frm.prgStatus.Value = 40
If AllFilesCheckBox.Value = True Then
frm.prgStatus.Value = 50
Call ListFilesInFolder(SourceFolder, IsSubFolder)
frm.prgStatus.Value = 60
Call ResultSorting(xlAscending, "C20")
frm.prgStatus.Value = 70
Else
Call ListFilesInFolderXtn(SourceFolder, IsSubFolder)
frm.prgStatus.Value = 80
Call ResultSorting(xlAscending, "C20")
frm.prgStatus.Value = 90
End If
Call FormatCells
lblFCount.Caption = iRow - 20
frm.prgStatus.Value = 100
End If
End If
frm.TaskDone = True
Unload frm
'The row below creates a 'On Screen' message telling the user that the workbook has been built.
iMessage = MsgBox("All the files have been extracted", vbOKOnly)
'The row below automatically takes the user to the "Launch Sheet".
End Sub
因为我正在使用双显示器,所以一直在研究如何将启动画面居中于“活动窗口”,其中一篇帖子引导我使用以下代码:
Private Sub UserForm_Initialize()
Me.BackColor = RGB(174, 198, 207)
With frmSplash
.StartUpPosition = 0
.Left = Application.Left + (0.5 * Application.Width) - (0.5 * .Width)
.Top = Application.Top + (0.5 * Application.Height) - (0.5 * .Height)
.Show
End With
End Sub
我现在遇到的问题是,虽然“闪屏”界面可见且现在居中于活动窗口,但提取宏不再起作用,我真的不确定原因。
我想知道是否有人能看一下这个问题,请告诉我我错在哪里。
非常感谢和问候
Chris