I haven't even seen the loop, indeed a bit inefficient but still should not pose a problem. I've converted 500+ Excel 2003 templates into OpenXML templates this way.

But what I find strange is that you open temp.xls and edit it, but save as another:
 Code:
$rc = $wbs.Open("\\server\share\folder\temp.xls")
  $filename = "\\server\shares\folder\$name-$key-$year-$month.xls"
  $app.ActiveWorkbook.SaveAs("$filename",-4143) 

Unless it is a template, but then it should be converted to temp.xlt.
Also, using
 Code:
$app.DisplayAlerts = 0
only works if you set it just after creating the object, not before you close the object.