LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with closing down a workbook?? Don Excel Worksheet Functions 1 May 9th 05 04:05 AM
Closing workbook Ed Excel Programming 4 February 6th 04 03:41 PM
closing excel after closing a workbook CWalsh[_2_] Excel Programming 3 January 21st 04 03:33 PM
Closing a workbook Belinda Excel Programming 2 January 15th 04 01:27 PM
problems closing workbook Kevin Excel Programming 2 December 17th 03 08:26 AM


All times are GMT +1. The time now is 08:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"