workbook error - please help

P

PBcorn

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
 
G

Gary''s Student

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top