需要在命令提示符中运行 VBA 代码
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15572243/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Need to Run VBA code in Command Prompt
提问by navamauricio
I have a Tiff file splitter DLL that has a VBA code:
我有一个带有 VBA 代码的 Tiff 文件拆分器 DLL:
Dim tsplit As New SCTiffPageSplitNetDLL.TiffPageSplitterDLL
Dim rslt as Integer
To call the function and split TIFF files, you could use the following:
rslt = tsplit.Tiff_PageSplit("C:\test\test.tif", "C:\outputdir")
MsgBox rslt
How can I run this line of code in a command prompt
? I need to make a batch file(.bat) out of this code.
我怎样才能在 a 中运行这行代码command prompt
?我需要用这段代码制作一个批处理文件(.bat)。
回答by wakjah
You could put it in a VBScript (.vbs) file and run it using cscript. See this thread How to run a .vbs from a .bat
您可以将它放在 VBScript (.vbs) 文件中并使用 cscript 运行它。请参阅此线程如何从 .bat 运行 .vbs