Posts by TAdamson1981

    Re: VBcomponent: Remove Before Close

    Hi, I posted the original thread a long long time ago, but still have not resolved the issue. The current workaround that I have is to have the user re-save the document after the code has been executed because as soon as control is passed back to the user the delete commands are actually executed. Unfortunately I already have EnableEvents to false, is there anything else out of the ordinary that you did to get it to work? A summary of what my code does: it creates a copy of the workbook (in an extremely horrible way), then executes the delete code commands, and then if I try to save that new workbook with the code deleted out of it it just saves it as if the code hadn't been deleted. Thanks.


    Re: VBcomponent remove before exit

    Yeah, I still have the same problem, they aren't removed until execution finishes. I tried saving a copy of the workbook hoping that during the save the removal would conclude but of course it just saves the current state and completely ignores that the remove commands were even run. Thank you Bill Gates.

    Re: VBcomponent remove before exit

    I'm deleting pretty much all the modules in my project, not just the one that is being called. I tried putting the for all the calls I made up to and during the .remove statements but I had no luck. I guess all the other modules are "locked" previously. It seems the classes are also locked down. Very annoying.

    Re: VBcomponent remove before exit

    Sorry, here's the code.

    I've been looking around and it seems .remove is the correct function but it won't delete it immediately, I was hoping there was a way to do that so I could save the changes before exiting the procedure. Thanks.

    I have been deleting some VBComponents by using the .remove command and they get tagged for deletion but do not actually get deleted until after my VBA sub ends and control is returned to excel. I would like to save the changes before control is returned to the user. I'm not really sure why the deletion is being held up until execution ends, it even waits until all calling functions have also finished their execution. Thanks.