View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default explicitly name workbook and close without saving

wbName = "MyFile.xls"
set wbk = workbooks(wbname)
wbk.Close SaveChanges:=false

or simply
workbooks("MyFile.xls").Close SaveChanges:=false




"laavista" wrote:

This seems like such a simple thing, but I need help!

I have 3 workbooks open. I need to close one of them without saving, and I
want to name the specific workbook to close.

I've tried lots of things. The latest is:

dim wbName as workbook

wbName = ("MyFile.xls")
wbName.Close SaveChanges:=false

Your help would be GREATLY appreciated!