explicitly name workbook and close without saving

  • Thread starter Thread starter laavista
  • Start date Start date
L

laavista

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!
 
wbName = "MyFile.xls"
set wbk = workbooks(wbname)
wbk.Close SaveChanges:=false

or simply
workbooks("MyFile.xls").Close SaveChanges:=false
 
Joel, you are a genius!!

Thanks so much for taking the time to help me with this! I really do
appreciate it!!
 
Back
Top