Make your workbooks talk like a pirate

talk like a pirate day

Happy Talk Like a Pirate Day!

In honor of such a special day, let's look at the API (or should I say, ARRPI) created just for learning how to talk like a pirate.

The API is extremely simple. Just pass it the text you want to translate to pirate-speak, and it returns the translated text.

First you'll want to get the MSXML class module I created. Then paste the following function into a standard module.

Function PirateSpeak(normalText As String) As String

  Const BASE_URL As String = "http://isithackday.com/arrpi.php?text="

  Dim msxml As clsMSXML
  Dim xml As Object ' MSXML2.XMLHTTP60
  Dim result As String

  Set msxml = New clsMSXML
  Set xml = msxml.GetMSXML

  result = msxml.GetResponse(xml, HTTP_GET, _
    BASE_URL & normalText, False)

  PirateSpeak = result

End Function

Sample Usage

Sub GetPirateTalk()
  MsgBox PirateSpeak("Hello, is there gold on that island?")
End Sub

If you really want a laugh, have Excel speak pirate!

Application.Speech.Speak PirateSpeak("Hello, is there gold on that island?")

For the record, I was extremely tempted to convert my entire site to pirate-speak (just for today), but decided against it at the last minute.

Now go and translate your Excel workbooks into pirate-speak for a day.

(Thanks to ProgrammableWeb for letting us know about the API.)

About JP

I'm just an average guy who writes VBA code for a living. This is my personal blog. Excel and Outlook are my thing, with a sprinkle of Access and Word here and there. Follow this space to learn more about VBA. Keep Reading »


Related Articles:


Share This Article:

Share and bookmark this articledelicious buttonfacebook buttonlinkedin buttonstumbleupon buttontwitter button

comment bubble 2 Comment(s) on Make your workbooks talk like a pirate:

  1. Awesome. I couldn't get mine to work though.

    GetResponse is not in the MSXML class module. So I changed it to GetXMLResponse, still not working with a 1004 error at:

    Application.Speech.Speak PirateSpeak("Hello, is there gold on that island?")

This article is closed to any future comments.
excel school learn dashboards