Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Closing a single Excel file vs. all files

Status
Not open for further replies.

MichaelHuber

Programmer
May 22, 2003
27
0
0
US
Hello All,
This is a pet peeve of mine, and hopefully there's a way to configure it.

In Excel 2002, when everything is maximized, there are 2 X's in the upper-right. The inner X closes the active file, and the outer X closes the ENTIRE Excel application. This behavior is different than other Office apps (like Word). Sometimes I'll have 5 or 6 different sheets open, and one inadvertent click means I have to find & re-open all of those files.

Is there a way to make the outer X in Excel behave like Word ...in other words, just close ONE file instead of the ENTIRE app?

Thanks,
Michael
 
don't know how you have your office apps set up but the standard way is for Word to work in the same way as all the others - one X is for the document / workbook, the other is for the application.

As another way of stopping you closing everything when you don't mean to - you should be asked if you want to save changes....

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Hmm... I just opened a few Word docs & clicked the extreme upper right X, and only one file closed (not all of them). Does anyone know why mine behaves differently than Geoff's? Can this behavior be applied to Excel as well?

Unfortunately, the "prompt for saving changes" doesn't apply. A lot of what I do requires looking up values in Excel sheets without modifying them. If there's a "confirm close" option in Excel, that might be a happy medium. :)

Thanks for your help,
Michael
 
Found it I think

Tools>Options Tick Windows In Taskbar

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Apologies:

Tools>Options>VIEW Tick Windows In Taskbar

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 

If xlbo's answer doesn't fix it, check to see if there is an Auto_Open macro that contains
Code:
Workbooks.Close
which would cause all workbooks to close when you click the X.
 
Geoff, that didn't solve it. "Windows in Taskbar" was already checked in both apps on my machine. I tried unchecking it, and the taskbar boxes combined together (as expected). With the boxes combined, the X in question shut down the entire app (for both Word and Excel). When I rechecked the option, the taskbar boxes split back out, and the behavior returned to "normal" ...whatever normal is. :)

It's almost like Excel is showing each individual box in the taskbar, but still thinks Excel is running under a single task (either that, or Word behaves unexpectedly). Ultimately, I'd like Excel to react the same way Word does.

dcompto, unfortunately there are no macros in my files.

Any help is appreciated.
Thanks,
Michael
 
My Word and Excel act as yours does, Michael.

'No time to look into why they're different right now, but here's a thought - I rarely if ever use the X at the top right to close windows. I use [Alt]+[F4] to close Excel completely and [Ctrl]+[F4] to just close one workbook.

That might take a little getting used to, but it seems like it would solve your problem.

[tt]_____
[blue]-John[/blue][/tt]

Help us help you. Please read FAQ181-2886 before posting.
 
Thanks for the suggestion, John. I might have to start getting used to that.

I figured out a couple workarounds (don't know if they're the best way to do it, though). It turns out that every time you open an Excel sheet, it uses DDE to open the file in the existing Excel instance. I tried the "Ignore other applications" checkbox in Excel, but that was a little too extreme. It shut off DDE entirely, which meant that Windows Explorer couldn't send messages to Excel.

Here's what I came up with for those who are interested:
1) Put a shortcut to Excel in your SendTo folder (e.g., C:\Documents and Settings\user\SendTo) ...then right-click the Excel file each time you want to open one, and select SendTo->Excel

2) Change the double-click action in the Windows file associations. From Windows Explorer, select Tools->Folder Options, and go to the File Types tab. Scroll down to find XLS, then click Advanced. I decided to make a new action rather than modifying the existing Open action. Click New, and type {Open in New Instance} for the action (without brackets). For the application, use something like {"C:\Program Files\Microsoft Office XP\Office10\EXCEL.EXE" "%1"} (without brackets, but make sure you have the quotes!). Your Excel path may be a little different, especially if you don't use Excel 2002. After OK-ing that box, make sure you click Set Default for the desired action (default double-click action is in bold). If you want to modify the existing Open action, I'm guessing you can Edit that action, then just put "%1" on the application line (maybe even remove the /e), then delete the DDE Message textbox. It's OK for Use DDE to be checked ...in fact if you un-check it, Windows will just assume you made a mistake and check it for you with a blank DDE Message. :)

The problem with (1) is that it's time-consuming. The problem with (2) is that every time you re-install (or upgrade), you'll have to re-define the action ...and you'll have to do the same thing for each file type you want to change!

I wish Excel offered a simple way to open files in a new instance every time. Oh well, maybe you can't have it all.
Thanks for your help, everyone.
-Michael
 
Excel's behavior is normal, Word's was changed in version 2000. Do a search for MDI (Multiple Document Interface) for more information. I found this in my searches:

"One of the most controversial changes introduced with Word 2000 is the switch from an MDI to an SDI for the program. MDI is an acronym for multiple document interface. Those who have used Word for a while know that you could open multiple documents, and then access different documents by using the Window menu. SDI is an acronym for single document interface. It means that the program can only open one document at a time. The result is that each document appears as a separate task on the taskbar.

Why was this change controversial? Other than the fact it represented a major change in how people worked, some people loved it and others hated it. Microsoft apparently got a lot of flack for their decision during the Word 2000 beta test period. It was strongly suggested that Microsoft make SDI an option so that those that hate it could stay with MDI and those that want it could go with SDI. Unfortunately, Microsoft said it couldn't be made an option because trying to program both approaches into the executables would have wrecked the way a lot of other parts of Word work under the hood. Microsoft claimed it had to be either SDI or MDI, but not both. Because their usability surveys pointed at greater acceptance for SDI, that was what we got.
 
HA! So what we have is an Excel MDI that looks exactly the same on the taskbar as the Word SDI!! And if you want them to look like a true MDI on the taskbar, you can check the "Windows in Taskbar" option in either program (even the Word SDI).

Wow. It's all making sense now (at least the what and a little of the why). Thanks for the research, pbrodsky.
-Michael
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top