Last active
August 5, 2025 13:56
-
-
Save touchiep/8cdc55f0b1956ecc69bc6c673bcaedb7 to your computer and use it in GitHub Desktop.
[VBA Excel] QR Code Generator for use with IMAGE function in Excel 365
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function QRCodeIO(InText As String, Optional oFormat As String = "png", Optional oMargin As Integer = 1, Optional oSize As Integer = 150, Optional oDark As String = "000000", Optional oLight As String = "ffffff", Optional ECLevel As String = "M", Optional LogoURL As String, Optional oCaption As String) | |
'QR Code for use with IMAGE function only. (MS 365 only) | |
'Using API from quickchart.io | |
Dim sURL As String | |
Dim Res As String | |
sURL = "https://quickchart.io/qr?" | |
Res = "text=" + WorksheetFunction.EncodeURL(InText) | |
Res = Res + "&format=" + oFormat | |
Res = Res + "&margin=" + Trim(str(oMargin)) | |
Res = Res + "&size=" + Trim(str(oSize)) | |
Res = Res + "&dark=" + oDark | |
Res = Res + "&light=" + oLight | |
Res = Res + "&ecLevel=" + ECLevel | |
If LogoURL <> "" Then Res = Res + "¢erImageUrl=" + WorksheetFunction.EncodeURL(LogoURL) | |
If oCaption <> "" Then Res = Res + "&caption=" + WorksheetFunction.EncodeURL(oCaption) | |
QRCodeIO = sURL + Res | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment