Hello.
I'm not a programming pro at all. I understand the basics... I needed to generate 2 QR-codes and have them placed in P37 and N50. In order, the code must :
- delete the 2 QR-codes (images) present in P37 and N50 if they exist,
- create and place the 2 new QR-codes.
After a lot of searching and trial and error, I came up with this code:
Administrator's note: Welcome to the Forum! Please take the time to review our rules. There aren't many, and they are all important. Our guidelines recommend code tags. I have added them for you this time because you are a new member. I also added indentation for readability. --6StringJazzer![]()
Please Login or Register to view this content.
Generally speaking, the code works, but there are 2 problems...
1) From time to time, the code bugs and suggests debugging the following line:
If I enter the debug, change absolutely nothing and save the VBA code, when I run the macro again, it works. Strange because I didn't change anything.![]()
Please Login or Register to view this content.
2) The code from which I drew inspiration had to delete several QR-codes from a range. The code therefore uses the "For each..." loop. However, not knowing how to code but understanding a little what was going on, I deleted the range concerned by the box I was interested in (P37) and then copied the code to rerun the operation for N50. It seems logical to me that the code isn't optimal since it uses 2 loops and each only deals with one element.
In short, I'd like a kind soul to simplify my code and ensure that I no longer have any untimely bugs so that I can use it without any worries.
I'm counting on your generosity.
Thank you for your help.
Bookmarks