Windows 10我在EXCEL宏中有VB代码,它在文本文件中搜索值并返回匹配项。问题是在执行时弹出DOS窗口。我不希望出现此窗口(或者如果它必须出现,在某处最小化)。我做了很多宏编码,但不是真正的技术,我知道。这是我的代码,这是工作,但显示DOS窗口。它确实情况在文本文件中insensitve搜索USERNAME值。我需要得到的结果,并通过他们阅读。所有帮助赞赏,但我希望它不是太技术或激烈。谢谢!
theCommand = "findstr /I /P "
theCommand = theCommand & " " & USERNAME & " " & ACTIVEEMPLOYEESLISTFILE
Set oShell = Nothing
Set oExec = Nothing
Set oOutput = Nothing
Set oShell = CreateObject("WScript.Shell")
Set oExec = oShell.Exec(theCommand)
Set oOutput = oExec.StdOut
While Not oOutput.AtEndOfStream
recordLine = oOutput.readline
MsgBox recordLine
Wend
字符串
我只是想DOS窗口不出现或最小化时,运行,并能够读取的结果(这是不是在一个文件返回)。
1条答案
按热度按时间k97glaaz1#
这似乎对我有用:
字符串