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.

3
  • 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. Commented Nov 5, 2019 at 12:56
  • 1
    You create the shell object and then run that, see here: stackoverflow.com/a/34012511/10645228 Commented Nov 5, 2019 at 13:20
  • Thanks, forgot to specify - I'm looking for a solution for a MacOS. probably that's different there. Commented Nov 5, 2019 at 13:31

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.