I found this excellent bit of code via this question in Patratacus answer; Generating 2D (PDF417 or QR) barcodes using Excel VBA
However the code is very much beyond me and i'm having inconsistent issues when producing a data matrix barcode label which i'm fairly sure is due to timing (every 4th or so barcode is scanning with the details of the product before it).
I believe this is because the code is getting a value, putting it into a named range which is then index / matching some values into other cells and text joining them to generate the barcode's value. I think this could be resolved if I call the barcode update via VBA after the subroutine is finished rather than using the formula to generate it which is happening as soon as the first value is updated.
The code has a built in way to trigger the QR barcode type but not for Data Matrix.
Sub Test_RenderQRCode()
Call RenderQRCode(Application.ActiveSheet.Name, "A2", "Hello World", "mode=M", False)
End Sub
Would anyone be able to provide me with how to do that for the DM format please?
I honestly can't even figure out how to begin to do this with the code. I tried using optimization code (e.g. disabling application updates , calculations etc.) in my code that is firing the barcode upon a cell value change but it did not resolve the issue.
For a DataMatrix it could be something like that:
The sub "RenderQRCode" remain the same as described on Generating 2D (PDF417 or QR) barcodes using Excel VBA