0

I wanted to run terminal .command file with script from Excel VBA Macro. I found out that I can use

Shell ("/Users/user/path/to/file/test.command")

but it throws an error

“test.command” can’t be opened because Microsoft Excel is not allowed to open documents in Terminal.

Is there any way to allow Excel to run Terminal commands?

I saw an option to change .command to .sh and run with chmod +x, but it does not do anything (no error, no result). Thanks in advance.

shrivallabha.redij
  • 5,832
  • 1
  • 12
  • 27
user1039698
  • 143
  • 1
  • 6
  • Which kind of file do you want to run? Try this: `"Line 1:Sub test() Line 2:Dim RetVal Line 3:RetVal = Shell("C:\Windows\System32\CMD.EXE", 1) Line 4:End Sub"`. That one will run Console. – David García Bodego Nov 05 '19 at 12:56
  • 1
    You create the shell object and then run that, see here: https://stackoverflow.com/a/34012511/10645228 – jmejay Nov 05 '19 at 13:20
  • Thanks, forgot to specify - I'm looking for a solution for a MacOS. probably that's different there. – user1039698 Nov 05 '19 at 13:31

0 Answers0