If you are using a regular timer control to run your process, it will stop when the common dialog is open.
To avoid this, use the API timer statements to create a timer, and place your process code in the callback routine that the timer API uses.
Here's an example. You'll need a form with a text box, a command button, and your Common Dialog control. This is the code for the form.
Option Explicit
Private Sub Command1_Click()
CommonDialog1.ShowOpen
Debug.Print "CommonDialog closed"
End Sub
Private Sub Form_Load()
StartTimer
End Sub
Private Sub Form_Unload(Cancel As Integer)
StopTimer
End Sub
And you will need this code in a module:
Option Explicit
Public TimerID As Long
Public Declare Function SetTimer Lib "user32.dll" (ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Public Declare Function KillTimer Lib "user32.dll" (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long
Public Sub StartTimer()
TimerID = SetTimer(0, 0, 50, AddressOf TimeOut)
End Sub
Public Sub StopTimer()
KillTimer 0, TimerID
End Sub
Public Sub TimeOut(ByVal hwnd As Long, ByVal uMsg As Long, ByVal idEvent As Long, ByVal dwTime As Long)
Static I As Single
I = I + 1
Form1.Text1.Text = I
End Sub
When you run the project, you will see the text counting up, showing the timer is running. This is done in the subroutine "TimeOut". This is where you would put the code to run your process.
When you click the command button, the Common Dialog is opened. Notice that the counter keeps running. When you close the dialog, the code after the open statement is executed. This is where you would put your code for the Common Dialog being closed by the user.
Note that when using a timer API like this, if your program ends without the form unload event being called ( like if you go into debug mode and then end the program ), the VB IDE will crash because the timer was not "killed". So save your work before running your program!
Hope this helps,
Robert