Hello,
I have an Excel table with several rows of data. On each row is a cell "Drawing", and I want to use Excel VBA to go to Everything and do a search for the contents of this cell "Drawing". The VBA code is below:
TempProgramID = Shell("C:\tmp\Everything\Everything.exe" & " -s " & SearchKey, vbNormalFocus)
SearchKey is the content of the cell "Drawing", but when the cell "Drawing" contains one or more spaces I get an error message in Everything: "Unable to open file list: C:\Windows\System32\4909 is not a valid file list." Where 4909 is a part of the content of cell "Drawing", which is "4022 673 4909".
Is there a way to fix this?
Thanks, JeroenM.
Shell command from Excel
Re: Shell command from Excel
Please try:
"" inside quotes = a single literal double quote (")
TempProgramID = Shell("C:\tmp\Everything\Everything.exe" & " -s """ & SearchKey & """", vbNormalFocus)
"" inside quotes = a single literal double quote (")
Re: Shell command from Excel
Thanks, it works fine now.