Guys, on Monday I worked ~ 4 hours to create my first CDR 2019 document with macros. An algorithm ensures, that the document is saved from time to time, those macros should process images from a folder and save the output in a new folder. After the last image had been created, my document with macros had been saved, and I finished my work.Today I want to use the macros again, opened my document, but there hadn't been any VBA code anymore. The last processed image had been saved with the document, but no VBA-Code is in.I also did a small test: I created a new document, wrote a small 'Hello World' Sub, where the document gets saved as well. I ran it, closed it and reopened it: No VBA anymore.If you want to use VBA, avoid Corel 2019!
probably macros are best stored in .GMS files
Thank you for reporting this. We can reproduce the issue and we're investigating for a fix.
For now, we can only recommend to save VBA macros separately in a GMS file, as shark_ already suggested.
This would not be so bad I think if at least the VBA documet events work...
Did you try this aspect, too?
I mean Document_QueryClose, PageActivate, ShapeChange etc... I do not have 2019 installed in order to test that.
Maybe it's a higher level of security. Theoretically you can make a virus besides the code doing something. In a .gms file you firstly must put it in a special path in order to run... A .cdr document it is necessary only to open it.
You can write macro, save it to GMS-file and make button for your macro on any CorelDraw's panel.
Document events may be processed from any gms-file. You can even set properties of your document and Document_Open will only process documents with the property you need
I all the time use GMS files.
But sometimes I need the document events. For instance, I have a GMS preparing the layout for cutting and I need it to update the page size according to selected document/page dimensions. It shows them on the form interface and makes calculations regarding the optimum arrangement. I have programmatically written the document events in order to send this information to the (waiting) GMS...
I use this approach because the similar events of GlobalMacros do something different (which I alo need)...
Of course I can find a different approach if needed but the most convenient way would be to just export the existing module/form in a GMS file created for 2019.