<p>I need to encode a 100KB+ string as base64 in VBA. Are there any built-in functions or COM objects available which will do this as a pure VBA approach is either complex or doesn't scale well at these volumes (see links from <a href="http://www.vbforums.com/showthread.php?t=379072" rel="noreferrer">dbb</a> and <a href="http://www.motobit.com/tips/detpg_Base64Encode/" rel="noreferrer">marxidad</a>)?</p>

You can use the MSXML Base64 encoding functionality as described at
www.nonhostile.com/howto-encode-decode-base64-vb6.asp
:
```
```
Function EncodeBase64(text As String) As String
  Dim arrData() As Byte
  arrData = StrConv(text, vbFromUnicode)      

  Dim objXML As MSXML2.DOMDocument
  Dim objNode As MSXML2.IXMLDOMElement

  Set objXML = New MSXML2.DOMDocument 
  Set objNode = objXML.createElement("b64")

  objNode.dataType = "bin.base64"
  objNode.nodeTypedValue = arrData
  EncodeBase64 = Replace(objNode.Text, vbLf, "") 

  Set objNode = Nothing
  Set objXML = Nothing
End Function
```
```