This is for "faster". Thanks for your suggestion, however


Posted by Mike on November 14, 2001 5:44 AM

This was your response, I follow it with my results.

* * * * * * * *

Sub SaveDelete()
'
' SaveDelete Macro
' Macro recorded 11/14/01 by Mike Zaccardo
'

'
Dim ThisBook
ThisFile = ActiveWorkbook.FullName
Application.Dialogs(xlDialogSaveAs).Show "S:\Purchasing\QUOTES\CLOSED\" & ActiveWorkbook.Name
If MsgBox("Delete " & ThisBook, vbYesNo) = vbNo Then
Exit Sub
End If

Kill ThisBook

End Sub

* * * * *

What happens is the file gets moved to the Closed
Folder (Brilliant). But I'm getting a Run Time Error
mismatch on the "Kill ThisBook". The File still remains in the Open Folder.

Suggestions

Posted by Mudface on November 14, 2001 6:13 AM

SaveDelete Macro Macro recorded 11/14/01 by Mike Zaccardo


Try changing 'Kill ThisBook' to 'Kill ThisFile' or change your second line to: -

ThisBook = ActiveWorkbook.FullName

Rather than ThisFile = ActiveWorkBook.FullName

Posted by faster on November 14, 2001 6:18 AM

SaveDelete Macro Macro recorded 11/14/01 by Mike Zaccardo

Strange. It looks like the variable ThisBook got changed to
ThisFile.

change

ThisFile = ActiveWorkbook.FullName

to

ThisBook = ActiveWorkbook.FullName

let me know if this works.

Posted by Mike on November 14, 2001 6:21 AM

SaveDelete Macro Macro recorded 11/14/01 by Mike Zaccardo

Posted by Mike on November 14, 2001 6:23 AM

Thanks Mudface "the Wizard". Worked fine when I changed to ThisFile.

SaveDelete Macro Macro recorded 11/14/01 by Mike Zaccardo



Posted by faster on November 14, 2001 6:25 AM

In General Declarations set "Option Explicit"

SaveDelete Macro Macro recorded 11/14/01 by Mike Zaccardo Strange. It looks like the variable ThisBook got changed to


Option Explicit forces you to declare all variables.
Having this set would have caught the error.
You can (and should) set it to be on by default in
TOOLS/OPTIONS/EDITOR/ and check

REQUIRE VARIABLE DECLARATION