View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
laavista laavista is offline
external usenet poster
 
Posts: 50
Default explicitly name workbook and close without saving

Joel, you are a genius!!

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



"Joel" wrote:

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!