Karthik Thandapani
Member
Hi,
I have a requirement where a macro button opens up the file explorer(activity1). From the file explorer, I manually select the intended file and open it(activity2). Since the excel file is considerably huge, it will take it's own time to open up. Here I require a code snippet to pause/hold the remaining macro code and start running it once the sheet is open & active.
Can anyone please help to get this done. Presently I have the below code;
I have a requirement where a macro button opens up the file explorer(activity1). From the file explorer, I manually select the intended file and open it(activity2). Since the excel file is considerably huge, it will take it's own time to open up. Here I require a code snippet to pause/hold the remaining macro code and start running it once the sheet is open & active.
Can anyone please help to get this done. Presently I have the below code;
Code:
Option Explicit
Sub Open_Explorer()
Dim stFolder As String
stFolder = "C:\Users\v-kart\Documents"
If Len(Dir(stFolder, vbDirectory)) <> 0 Then
Shell "Explorer.exe /n,/e," & stFolder, vbNormalFocus
Else
MsgBox "The directory does not exist!", vbCritical
End If
With ActiveSheet
Sheet1.Cells.Clear
'other macro to call
End With
End Sub