Barcodes on container labels using API -VBA

MPicker

New Member
Joined
Feb 27, 2025
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Afternoon All,

I need some help with a scenario at work, we current have a very basic label on some containers that are text based and mean a manual intervention at every process

I would like to add a barcode to the label so we can utilize some basic scan guns we have to scan the work into certain production areas

I previously managed to do this with some googling and a google charts API for QR codes but it seems to have stopped functioning correctly.

the bar code must be code128 format.

this is the current code i have ( again stolen from googling I'm not to clued up on VBA coding yet ) this code does create a picture of the barcode but it appears very random, some times it will be in the cell i require, but to the top left with no movement even if i change the values in the positioning

is there a more "neat" way to do this, i cant install fonts or any upgrades to 365 as its ICT controlled and they dont allow changes.

Any help will be greatly appreciated.

Function GETQRCODES(QrCodeValues As String)
Dim URL As String
Dim CellValues As Range
Set CellValues = Application.Caller
URL = "https://barcodeapi.org/api/auto/ " & QrCodeValues
On Error Resume Next
ActiveSheet.Pictures("Generated_QR_CODES_" & CellValues.Address(False, False)).Delete
On Error GoTo 0
ActiveSheet.Pictures.Insert(URL).Select
With Selection.ShapeRange(0)
.Name = "Generated_QR_CODES_" & CellValues.Address(False, False)
.Left = CellValues.Left - 1
.Top = CellValues.bottom - 1
End With
GETQRCODES = ""
End Function
 

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top