If I try to use a document event but it works only in Untitled ones. After save, when I reopen it I am asked about enabling macros, I press Enable but nothing happens. Any of its events do not work. In IDE the name of the file does not appears in parenthesis after VBAProject (in case of events existing)... It looks it is hidden. I mean enumerating VBAProjects in VBA, its name appears like being a VBProject.
Is that a general problem of X8 (maybe a strange security one...) or only my installation has a problem?
Is it something to be done in order to activate events?
I tried some workaround which works but also in strange circumstances. I use a reference at 'Microsoft Visual Basic for Applications Extensibility 5.3' and that gives me the possibility to programmatic copy an event from a document/GSM to another document. When that document does not have a path (type Untitled) it works. If I save it all event code stays there but stops working. If I copy such an event in a document (saved) not having VBProject (not any VBA) it is not working, too.
Another annoying issue is the next:
If you save a document having an event code and after that you delete that code, somehow some VBA garbage remains inside that document. When I open it I am prompt about macro Enabling, even if not a line of VBA code exists any more. On top of that, if you have a big document with more then 100 pages, that in-existing VBA project (garbage) loads first and the document itself loads only after that. You cannot see the message asking about Enabling macro. If you call a function from a button outside VBE, CorelDRAW crashes... In such cases I learned it is necessary to play with Ctrl + Tab until I find the message about macro Enabling and press one of its buttons. Otherwise corelDRAW crashes...
Is there a way to clean the document of its VBA garbage in order not to be prompted regarding macro enabling?
Thanks in advance!
P.S. Any idea about whatever issue presented here will be well appreciated, even strange approach will be presented...
Any macro?
This means I must be happier... I my case events just do not work.
I would suggest Corel reinstalling.
Rob,
You need to set break points in any of the Events code, that way you can step through it and see which line is crashing CorelDRAW.
-Shelby
So, events should work in X8 64bit? Do you have an idea about the problem of my installation even if I uninstalled and reinstalled ii several times? What would be good to try?
And what about document cleaning of VBA garbage after deleting all VBA code...
Try to download this document:www.dropbox.com/.../171026_01.cdr When I click on it in the explorer (Corel isn't running) X8 is starting with this document.
In the ObjectBrowser I see some pages and some layers. When I toggle between, nothing happens.
Then I try to open the VBA-Editor (<Alt>-<F11>) I've been asked If I trust those macros. Then I agree.
Afterwards each LayerChange causes at least one MessageBox.
When I close this document (not Corel!) and open it again either from the Recent Files or with clicking on it in the explorer I've been directly asked, if I trust the macros - I agree again, but then: Nothing happens.It seems to be necessary to open the document directly with Corel, then the events will work, otherwise they are not recognized for any un-understandable reason
I understood what you are saying from your (own) previous post. I tried it and it doesn't work in my case. And I do not know what to do in order to solve this events not working problem.
I also cannot how to solve the VBA garbage problem. When I saved a document with some VBA code and after a while I delete all code it keep asking about Enabling Macros even if there is not any code line inside. This shouldn't be so annoying if in case of big size documents (more then 100 pages) the warning message is loaded first and document itself after that, the message not being visible any more. If you try to start a macro Corel crashes...