2

I have a simple requirement

I want to write 'Hello world' to windows cmd.exe from VBA (excel)

I referred 'Shell' and few other posts but could not do it

user692942
  • 16,398
  • 7
  • 76
  • 175
Sathish Kumar
  • 2,150
  • 10
  • 29
  • 51

1 Answers1

2

The following worked:

strToPrint = "Hello World!"
Shell "cmd.exe /K echo " & strToPrint, vbNormalFocus
Reza Aghaei
  • 120,393
  • 18
  • 203
  • 398
Sathish Kumar
  • 2,150
  • 10
  • 29
  • 51