我的程序中有一个模块,当从主程序调用时会运行它,但我无法单步执行它或单独运行它,我不知道为什么。当我按 F8 时,似乎什么都没有发生。我希望能够在单步执行代码时监控变量。
这是模块中的代码:
Sub FileCntSub(ByVal StrPath As String)
Dim FolderPath As String, path As String, count As Integer, countstring As String
FolderPath = StrPath
path = FolderPath & "*.htm"
Filename = Dir(path)
Do While Filename <> ""
count = count + 1
Filename = Dir()
Loop
countstring = count
Range("Q8").Value = count
'MsgBox count & " : files found in folder"
结束子
任何想法为什么我不能单独运行这个?
谢谢