试试以下代码,看能不能满足你的要求.- Set wshobj=WScript.CreateObject("WScript.Shell")
- code="在Excel中使用查找对话框可以查找工作表中特定内容的单元格,而在VBA中则使用Find方法,如下面的代码所示。"
- wshobj.Run "cmd.exe /c echo " & code & "| clip.exe", vbHide
- app=wshobj.Run ("C:\windows\notepad.exe")
- WScript.Sleep 1000
- wshobj.AppActivate app
- wshobj.SendKeys "^v"
- WshShell.SendKeys "%FS"
- WScript.Sleep 500
- WshShell.SendKeys "T.txt"
- WshShell.SendKeys "%S"
- WScript.Sleep 500
- WshShell.SendKeys "%FX"
- Wscript.Quit
复制代码
|