Сыскал в закромах
[vba]Код
Sub Мяу
Filename = Environ("temp") & "\" & "AA.vbs"
fn = ThisWorkbook.FullName
Strc = "fn = " & Chr(34) & fn & Chr(34) & vbNewLine
Strc = Strc & "Filename = " & Chr(34) & Filename & Chr(34) & vbNewLine
'
Strc = Strc & "t = Timer" & vbNewLine
Strc = Strc & "While Timer - t < 5" & vbNewLine
Strc = Strc & "Wend" & vbNewLine
Strc = Strc & "MsgBox ""QQéé""" & vbNewLine
Strc = Strc & "With CreateObject(""scripting.filesystemobject"")" & vbNewLine
Strc = Strc & ".DeleteFile fn" & vbNewLine
Strc = Strc & ".DeleteFile Filename" & vbNewLine
Strc = Strc & "End With" & vbNewLine
With CreateObject("scripting.filesystemobject").CreateTextFile(Filename, True)
.Write Strc: .Close
End With
With CreateObject("Shell.Application")
.ShellExecute (Filename)
End With
DoEvents
ThisWorkbook.Close False
End Sub
[/vba]