I am attempting to have a macro run within Excel that builds a PowerPoint presentation and meanwhile have a userform cancel button that is displayed while the macro is running, that the user can press to stop the macro. For the macro to run while the cancel button is showing, I have the code within UserForm_Activate. The cancel button is linked to the following:
And the code within UserForm_Activate constantly checks the value of CancelSOV and is supposed to Exit Sub when it = True.
-Main issue: As the code within UserForm_Activate is running and specifically building a powerpoint presentation, I am unable to click on the cancel button. I do have Application.ScreenUpdating = False while code runs, if you think that's the issue.
-Since moving my code to the UserForm_Activate, one of my counters is not functioning properly when the macro is run a second time- as if it's saving the value from the previous time. I have even attempted to set it to 0 and then reset it, but somewhere in the code it's going back to the counter from the last time the macro was run?
Code:
Private Sub SOV_Cancel_Click()
CancelSOV = True
SOV_Form.Hide
End Sub
-Main issue: As the code within UserForm_Activate is running and specifically building a powerpoint presentation, I am unable to click on the cancel button. I do have Application.ScreenUpdating = False while code runs, if you think that's the issue.
-Since moving my code to the UserForm_Activate, one of my counters is not functioning properly when the macro is run a second time- as if it's saving the value from the previous time. I have even attempted to set it to 0 and then reset it, but somewhere in the code it's going back to the counter from the last time the macro was run?
Last edited by a moderator: