' Store the Activeworkbook in a variable.
Set aw = ActiveWorkbook
For Each wb In Workbooks
If wb.Path <> "" Then ' Save file if it has been saved
Else ' If not previously saved, activate and show the
' Save As dialog box.
aw.Activate ' Activate the original Activeworkbook.