Created
August 5, 2025 13:59
-
-
Save touchiep/bb91a97f9cf6ddcb1216314cfa42349a to your computer and use it in GitHub Desktop.
[VBA Excel] QR Code Generator for IMAGE function in MS 365 by using API from QRServer.com
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 GenQRCode(InData As String, Optional ImgSize As Integer = 150, Optional FGColor As String = "000000", Optional BGColor As String = "FFFFFF", Optional FFormat As String = "png", Optional QZone As Integer = 1) | |
| 'QR Code for use with IMAGE function only. (Microsoft 365 only) | |
| 'Using API from QRServer.com | |
| Dim sURL As String | |
| sURL = "https://api.qrserver.com/v1/create-qr-code/?" + "size=" + Trim(str(ImgSize)) + "x" + Trim(str(ImgSize)) + "&color=" + FGColor + "&bgcolor=" + BGColor + "&format=" + FFormat + "&qzone=" + Trim(str(QZone)) + "&data=" + WorksheetFunction.EncodeURL(InData) | |
| GenQRCode = sURL | |
| End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment