Returning results from Shell function using Excel VBA

Plug-in and third party software discussion.
Post Reply
Tank Ersley
Posts: 11
Joined: Sat Aug 05, 2023 5:48 pm

Returning results from Shell function using Excel VBA

Post by Tank Ersley »

Hi.

I have this code to get a list of results based on a RegEx search of Everything.

Code: Select all

Dim searchRegex As String

searchRegex = Activesheet.Range("A:A").Find("Everything RegEx").Offset(0, 1)

Shell "C:\Program Files\Everything\Everything.exe -s """ & searchRegex & """ -regex -sort ""Path"""
It opens Everything with the results displayed.

Is there a way to send these results back to VBA as a delimiter-separated list? I am trying to get a count and, if necessary, output the list to a range of cells.

I thought creating a filelist might be useful but:
  • I'm hoping to avoid having to create a file just to read from it and then delete it
  • I have not found a way to limit it to filenames only (no other properties)
  • It seems to be limited to searching a particular folder, not all of the ones set up in Everything.
Any advice would be greatly appreciated.
NotNull
Posts: 5261
Joined: Wed May 24, 2017 9:22 pm

Re: Returning results from Shell function using Excel VBA

Post by NotNull »

A similar question on this forum: Use of Everything from Excel VBA
Tank Ersley
Posts: 11
Joined: Sat Aug 05, 2023 5:48 pm

Re: Returning results from Shell function using Excel VBA

Post by Tank Ersley »

I looked at that thread. It involves using the SDK.

I was trying to see if the results from the Shell function could be used instead.

I presume from your response that it cannot.

Thanks for the response.
Post Reply