Forum

Notifications
Clear all

VBA for QR Codes

10 Posts
3 Users
0 Reactions
134 Views
Philip Treacy
(@philipt)
Posts: 1630
Member Admin
Topic starter
 

Hi Philip, have you done any work with QR codes, I need a solution which allows me to link to a cell value and update the QR when the cell value changes. 

 
Posted : 16/05/2020 9:49 am
Philip Treacy
(@philipt)
Posts: 1630
Member Admin
Topic starter
 

Hi Andy,

no not really.  Do you already have code for this?

Phil

 
Posted : 16/05/2020 8:06 pm
(@and180y)
Posts: 8
Active Member
 

I have tried every one I can find on Google to no avail. They all run with errors. 

 
Posted : 16/05/2020 8:09 pm
(@and180y)
Posts: 8
Active Member
 

This sheet, (just a test sheet) has two different macros which should do it but neither work one via the button and the other with a call. 

 
Posted : 16/05/2020 8:13 pm
Philip Treacy
(@philipt)
Posts: 1630
Member Admin
Topic starter
 

Hi Andy,

Where did you get this code?  Did you get that workbook like that?  It's a bit messy!

There are 4 modules and 3 Subs with the same name so that's why the code isn't working.

Attached is a working version. Put the text to encode into G2.  If you look at the Render_QRCode sub in Module 3 you'll see that it is set to pickup the value in G2.  You can change this to whatever cell you like.

Cheers

Phil

 
Posted : 16/05/2020 11:54 pm
(@and180y)
Posts: 8
Active Member
 

Phil, thankyou so much for your help with this, it works perfectly. 🙂 

 
Posted : 21/05/2020 6:55 pm
Philip Treacy
(@philipt)
Posts: 1630
Member Admin
Topic starter
 

No worries.

 
Posted : 21/05/2020 7:22 pm
(@keebellah)
Posts: 373
Reputable Member
 

Hi Phil,
Excuse my budding in but I was trying to help someone of the Excel Help Forum ( https://www.excelforum.com/excel-programming-vba-macros/1330377-require-vba-code-for-qr-code-new-post.html )

The texts this person is using somehow throws an error and shuts down Excel.

I tested the text with your file here and the same issue. No error message just bang - Excel shuts down and restarts

this is the text to create QR code

FIN STAT     SALE  NP 0 CA  0 LOAN  INVEST       DRS  Cash in Hand  Cash @ Bank     Balance 0 Depreciation 0 Closing WDV 0 HP  80C 0 Ch VI 0 Tax Payble 0

Just curious what it could be.

 

Cheers,

Hans

 
Posted : 22/10/2020 2:36 am
Philip Treacy
(@philipt)
Posts: 1630
Member Admin
Topic starter
 

Hi Hans,

It appears to have something to do with the length of the string.  If you split the string into 2, both halves encode without issue.

I haven't figured out why it crashes with the full string.  I'm not familiar with the VBA, it was in the file supplied for this particular problem.

Phil

 
Posted : 23/10/2020 7:08 am
(@keebellah)
Posts: 373
Reputable Member
 

Hi Phil,

I figured out that much, passing shorter strings had no problems and also the text in the string is not really something I would use in a QR-code either.

Was just curious; anyway I could not find a text length limit to QR-code gerenation.

 

Thanks for looking.

This is (for me at least) no longer an issue 

 

Cheers and keep safe,

 

Hans

 
Posted : 24/10/2020 8:34 am
Share: