I researched net, but I haven`t found a solution yet and I am still grappling with the following problem:
In vba UserForm I have two command buttons:
- 1st one ('Run Operation') runs an operation that could take around 30 minutes.
- 2nd one ('Cancel') was created to interrupt the operation that was triggered off by 'Run Operation'
When I press 'Run Operation' button I cannot press neither 'Cancel' nor 'x' to stop the running operation and I have to wait until the operation finishes, thus the userform is freezed for around 30 minutes.

Code looks more or less like this:
private Sub Cancel_Click()
Cancel = True
End Sub
private Sub RunOperation_Click()
RunOperation.Enabled = False
Call Macro()
End Sub
private Sub Macro()
For i = 1 to 100
'do stuff here
If Cancel = True Then
RunOperation.Enabled = True
Exit Sub
Exit If
Next i
End Sub
What`s more both buttons have TakeFocusOnClick set to False.
I`d be grateful for any ideas.
Thanks in advance !
'do stuff here, insert the commandDoEvents(all one word).