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
  • 15,667
  • 7
  • 74
  • 164
Sathish Kumar
  • 1,720
  • 7
  • 20
  • 40

1 Answers1

2

The following worked:

strToPrint = "Hello World!"
Shell "cmd.exe /K echo " & strToPrint, vbNormalFocus
Reza Aghaei
  • 112,050
  • 16
  • 178
  • 345
Sathish Kumar
  • 1,720
  • 7
  • 20
  • 40