Search code examples
excelvbaterminalasciicommand-prompt

Adding ascii-art to command prompt through VBA


I have some code that opens up command prompt, and requires a user to sign in through windows command prompt. I've gotten complaints about it being really ugly that they have to log in like that, so I thought I'd add some Ascii-art to the terminal so it gives something to look at (below). Any ideas how I would be able to format that in VBA to result in some nice art for the terminal? shellOUT = oShell.Run("cmd.exe /s /c echo Art Here & " & f & " " & cf, vbNormalFocus, True) it would need to go in between "Echo" and "&" where it says "Art Here"


       ____             
      / __ \ ___  _   __
     / / / // _ \| | / /
    / /_/ //  __/| |/ / 
   /_____/ \___/ |___/  
                        


Solution

  • You can do:

    Dim myArt As String
    
    myArt = _
        "       ____             " & vbNewLine & _
        "      / __ \ ___  _   __" & vbNewLine & _
        "     / / / // _ \| | / /" & vbNewLine & _
        "    / /_/ //  __/| |/ / " & vbNewLine & _
        "   /_____/ \___/ |___/  " & vbNewLine & _
        "                        " & vbNewLine
    
    shellOUT = oShell.Run("cmd.exe /s /c echo " & myArt & ..., vbNormalFocus, True)