1. My suggestion would have been to use DoEvents but seems that didn't work for you...so i can't help there.
2. Try this out:
Code:
Public Type SHFILEOPSTRUCT
hwnd As Long
wFunc As Long
pFrom As String
pTo As String
fFlags As Integer
fAnyOperationsAborted As Long
hNameMappings As Long
lpszProgressTitle As Long
End Type
Public Declare Function SHFileOperation Lib _
"shell32.dll" Alias "SHFileOperationA" (lpFileOp _
As SHFILEOPSTRUCT) As Long
Public Const FO_DELETE = &H3
Public Const FOF_ALLOWUNDO = &H40
'CODE
Dim SHop As SHFILEOPSTRUCT
Dim strFile as string
strFile = "C:\windows\desktop\test.txt"
With SHop
.wFunc = FO_DELETE
.pFrom = strFile
.fFlags = FOF_ALLOWUNDO
End With
SHFileOperation SHop
'Code take from vb-world tips and slightly modified.
Hope that helps,
D!m