Thanks BabyTiger,But the Command Line
Workbooks(ww & ".tmp").Close (False)
Still error!! so I write the Whole Command for anybody can see again maybe have other idea to Help. First I call SubDeleteA1 after that I call Sub UndoMacro but it will error on
Workbooks(ww & ".tmp").Close (False) ,So any idea ? Thanks.
dim ww
Sub DeleteA1()
SetUndoPoint
Range("A1").value = ""
End Sub
Sub SetUndoPoint()
WW = ThisWorkbook.Path & "\" & Left(ActiveWorkbook.Name, InStr(ActiveWorkbook.Name, ".") - 1)
ActiveWorkbook.SaveCopyAs WW & ".xlu"
End Sub
Sub UndoMacro()
Application.ScreenUpdating = False
WW = ThisWorkbook.Path & "\" & Left(ActiveWorkbook.Name, InStr(ActiveWorkbook.Name, ".") - 1)
ActiveWorkbook.SaveAs WW & ".tmp" 'Close File.xls
Workbooks.Open WW & ".xlu" 'Call old File before Change
Application.DisplayAlerts = False
Sheets(zz).Select
ActiveWorkbook.SaveAs WW & ".xls" 'change name to the old one
Kill WW & ".xlu"
Application.DisplayAlerts = True
Workbooks(ww & ".tmp").Close (False) ** Problem Line
Kill WW & ".tmp"
End sub