View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
N E Body[_2_] N E Body[_2_] is offline
external usenet poster
 
Posts: 1
Default Problems closing a workbook with VBA

Hi everyone

I coded a button on a userform with Application.Quit - all was fine.

I run into problems if more than one file is open as all the file
close when the code is run.

I changed the code to ThisWorkbook.close

This is OK if more than one file is open however if the workbook is th
only one open I am left with the blue bar, menu bar and toolbars at th
top of a grey screen when I run the code.

Is there a way of saying

If <if there is more than one file open Then
ThisWorkbook.Close
Else
Application.Quit
End If


Any Suggestions?

TIA

Kenny
Win ME and 2000
Office 97 and 200

--
Message posted from http://www.ExcelForum.com