打开拖放/删除的Excel文件w / .vbs并应用VBA宏

时间:2017-05-12 14:22:07

标签: excel vba vbscript

尝试打开我拖放到.vbs脚本上的Excel文件,如下所示:

Wscript.echo "Begin..." 

Set objArgs = Wscript.Arguments   dropped file
Wscript.echo "The file name you dropped is:" & objArgs(0)
CreateObject("WScript.Shell").Run "objArgs(0)"
Wscript.echo "...Finished"

导致错误的行是CreateObject("WScript.Shell").Run "objArgs(0)"

如何让vbs代码打开它,然后将宏应用于该Excel文件?

0 个答案:

没有答案