View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default workbook error - please help

Sub closeit()
Workbooks("Book1").Saved = True
Workbooks("Book1").Close
End Sub

--
Gary''s Student - gsnu2007q


"PBcorn" wrote:

why does

workbooks("book1.xls").close

(book1 is open in the current instance of excel, code is in book2)

generates a subscript out of range error - why? i have tried specifying
savechanges = .... but this is an optional argument i believe