View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Closing workbooks

If you close the workbook that contains the macro, the macro stops. Close
the other workbook first

Workbooks("Book2.xls").Close SaveChanges:=Fasle
ThisWorkbook.Close SaveChanges:=False

--
Regards,
Tom Ogilvy

"Mischa Browne" wrote in message
...
Hi



Struggling with the following problem.



Is it possible to close two workbooks working with VBA?



I have tried following codes:



Application.DisplayAlerts = False 'step 1
Windows("Book1.xls").Close 'step 2

Windows("Book2.xls").Close 'step 3
Application.DisplayAlerts = True 'step 4





Problem is, macro stops running after step 2!







Thanks,

Mischa