VbComponents.Remove doesn't always remove module

后端 未结 8 888
我寻月下人不归
我寻月下人不归 2021-01-02 01:01

I\'m trying to use Chip Pearson\'s code for overwriting an existing VBA code module with an import from another project. Original code here.

The particular section

8条回答
  •  庸人自扰
    2021-01-02 01:20

    I have struggled with this problem for many months and have finally found a solution thanks to Rob Bovey (http://www.apps-pro.com/).

    The trick is to use the Application.OnTime function to call a second procedure with the code you want to run after deleting the code modules.

    Application.OnTime Now(), "Your_Procedure_Part2"
    

    This seems to mimic the VBA code stopping and restarting. Any code after this line in the calling procedure will not be run.

提交回复
热议问题