Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
需要在命令提示符下运行VBA代码_Vba_Batch File_Tiff - Fatal编程技术网

需要在命令提示符下运行VBA代码

需要在命令提示符下运行VBA代码,vba,batch-file,tiff,Vba,Batch File,Tiff,我有一个Tiff文件拆分器DLL,其中包含VBA代码: 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") Msg

我有一个Tiff文件拆分器DLL,其中包含VBA代码:

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

如何在
命令提示符下运行这行代码?我需要用这段代码生成一个批处理文件(.bat)。

您可以将其放入VBScript(.vbs)文件中,然后使用cscript运行它。查看此线程

您可以将其放入VBScript(.vbs)文件中,并使用cscript运行它。查看此线程

如何将其放入vbs?谢谢。我试过了,但没有成功:Set Obj=CreateObject(“TiffPageSplitDLL.TiffPageSplitterDLL”)strPath=“%USERPROFILE%\Desktop\”strFile=“splitme.tif”strDest=“%USERPROFILE%\Desktop\”strFile=strPath&strFile rslt=Obj.Tiff_PageSplit(cstr(strFile),strDest)Set Obj=NothingYes,我得到:ActiveX组件无法创建对象:“TiffPageSplitDLL.TiffPageSplitterDLL”。这是一个代码错误还是不能创建?这意味着DLL没有注册,或者您把它的名字弄错了。我注意到您在VBA代码中称之为SCTiffPageSplitNetDLL.TiffPageSplitterDLL,但在VBScript代码中称之为TIFFPAGESPLITTDLL.TiffPageSplitterDLL。。。这可能是问题所在。嗯。。。我仍然认为这一定是你的名字的问题。尝试使用此实用程序以确保绝对可靠。如何将其放入vbs?谢谢。我试过了,但没有成功:Set Obj=CreateObject(“TiffPageSplitDLL.TiffPageSplitterDLL”)strPath=“%USERPROFILE%\Desktop\”strFile=“splitme.tif”strDest=“%USERPROFILE%\Desktop\”strFile=strPath&strFile rslt=Obj.Tiff_PageSplit(cstr(strFile),strDest)Set Obj=NothingYes,我得到:ActiveX组件无法创建对象:“TiffPageSplitDLL.TiffPageSplitterDLL”。这是一个代码错误还是不能创建?这意味着DLL没有注册,或者您把它的名字弄错了。我注意到您在VBA代码中称之为SCTiffPageSplitNetDLL.TiffPageSplitterDLL,但在VBScript代码中称之为TIFFPAGESPLITTDLL.TiffPageSplitterDLL。。。这可能是问题所在。嗯。。。我仍然认为这一定是你的名字的问题。尝试使用此实用程序以确保绝对安全。