Home > Software engineering >  VBA call dir in CMD black box
VBA call dir in CMD black box

Time:09-16


Ar=Split (. Exec (" CMD/dir/a - d/c b/s "& amp; CRH (34) & amp; MyPath & amp; "\ *. XLS *" & amp; CRH (34)). StdOut. ReadAll, vbCrLf)

There is a great god can help change the code to run when don't pop up black box interface, there are other code or replace the function,
Can have a null value into the array, is there any way to get rid of,

CodePudding user response:

refer to the original poster qq_34603610 response:
ar=Split (. Exec (" CMD/dir/a - d/c b/s "& amp; CRH (34) & amp; MyPath & amp; "\ *. XLS *" & amp; CRH (34)). StdOut. ReadAll, vbCrLf)

There is a great god can help change the code to run when don't pop up black box interface, there are other code or replace the function,
Can have a null value into the array, is there any way to get rid of,

is there any great god

CodePudding user response:

Vba you don't have the dir function? Loop and recursive, all subfolders under qualified filename screen out,

Using FSO can be achieved, online code a lot

CodePudding user response:

You mean, in addition to the replacement, there is no way to get rid of the black box

CodePudding user response:

Help you checked it, seems to want to get the results, use StdOut, has the black window, if you want to continue to use the method of you also don't want the black window, try to use the API to window hidden?

CodePudding user response:

How to change the code, can I give you all,
  •  Tags:  
  • VBA
  • Related