Sdi

S

Sniq_e

Hi there peeps.

I have searched the Internet extensively for a kludge and am close to
believing that it is not possible but...

Can Excel be duped into behaving in a SDI manner?

The reason that I ask is to be able to avoid the following situation:

1. I create a workbook but do not save it.
2. I get an e-mail with an xls attachment
3. I open, read and want to close the attachment
4. I click the big X (Its natural behaviour... this works in Word)
5. Excel prompts me about saving some workbook
THIS IS THE DANGEROUS BIT...
Excel is talking about my original workbook
But the damnable software does not bring the workbook
that it is talking about to the front
6. Thinking that Excel is moaning about changes to the attachment,
partly because Excel asks this question all the time, even when
changes have not been made, I click "No"
7. All Excel closes, losing me my work.

I hasten to add that this does not happen to me (OK, it did happen
once) but I have two or three users to whom this repeatedly happens...
and I have to agree with their frustration...

Is there anything that I can do?

I've tried the "ignore other applications" checkbox - although all this
serves to do is stop Excel listening to Windows DDI calls, so it won't
open any spreadsheets from Explorer, IE, Outlook, etc...

I've also looked at the "Windows in taskbar" option, which does not
help in the slightest.

By default, I have "group similar taskbar items" off in Windows (XP Pro
SP2).

I have tried kludging the XLS file association entries in Win Explorer
but this serves to muck up the file associations and requires an Excel
/unregserver /regserver combo...

So, I have tried turning the "ignore other applications" on and then
trying to get Excel to open by adding a %1 to the end of the registry
entry that is behind the XLS File association (editing the registry
entry does not seem to upset the association where editing the entry
from tools options in Windows Explorer does)

However, nothing seems to work... the "ignore other applications" does
open separate instances of Excel (but empty ones)...

And I KNOW it is possible because opening multiple instances of Excel
and using File Open works... so what can I do to trick Excel? Is there
a way of changing the interfering with Excel spotting that it already
has an instance open? Is there a way to encourage Excel to open a
dbl-clicked XLS file with the "ignore other apps" on? Is there a way
of writing an autoexec macro that asks whether this instance has two
workbooks open and, if so, closes the second and opens that book in a
new instance?

Surely there must be something cunning that can be done?

Please, somebody help me!!!

Thanks,
Andy
 
D

Dave Peterson

Yep. Excel and MSWord behave differently.

For me, I still live with one item in the taskbar (like using xl97).
(tools|options|view tab|windows in taskbar unchecked)

That serves as a reminder that I'm closing the single application when I use
that giant application X.
 
S

Sniq_e

OK, thanks for the reply, Dave... but I don't want to accept defeat so
readily... with Excel set to "ignore other applications",you can still
get Excel to run correctly by running a dos prompt, browsing to the [in
my case] "c:\program files\microsoft office\office10\" directory and
then typing "Excel TARGET.XLS" to open the TARGET file... and, surely,
at it's most fundamental level, this is all Windows does when it
invokes the default program as a file handler... What I'm trying to
drive at is this - if I create myprog.exe and assosiate it with .mpr
files then.... I would expect, upon double clicking a test.mpr file for
Windows to invoke myprog.exe with the argument test.mpr in an identical
way to me typing "myprog test.mpr" at the DOS prompt... and, surely,
telling Windows "%1" in the "OPEN" section of the file associations
settings box in Windows Explorer ought, by all rights, to do precisely
this!!! It seems, though that MS in their infinite wisdom (or infinite
desire to cover up the fact that they can't right code for ****), have
deliberately setup the office file associations in a different way...
as evidenced by the fact that changing the very slightest setting in
any office file association setting causes the whole of Office to
suddenly misinterperet a space in the filename or path... so... I
deduce that MS wrote a bloody aweful kludge to get Office and/or
Windows to accept spaces in filenames and, as a result, the file
associations have to use a non-standard mechanism to pass the file
arguments... although this sounds like an operating system based on
DOS, like win 95, but I thought that XP Pro was definitely NOT based on
DOS... I am so confused... and I don't understand how Microsoft manage
to exist whilst writing such completely inefficient code (except that
Intel probably pay they big bucks to write badly...)

Any help would be greatly appreciated... although I am off to associate
a .xxx file with excel and see whether I can rename .xls files as .xxx
and get Excel to open them in "ignore other applications" mode... then
I might need to write an add-in to Excel to get it to properly
interperet a XXX file as if it were a XLS file and I should be in
business...

Any help/ideas/comments would be greatly appreciated!

Thanks,
Andy

Dave Peterson
--Yep. Excel and MSWord behave differently.
--For me, I still live with one item in the taskbar (like using xl97).
--(tools|options|view tab|windows in taskbar unchecked)
--That serves as a reminder that I'm closing the single application
when I use
--that giant application X.
 
S

Sniq_e

Yup!!!

We have success...
I have a kludge...

If you create a one line CMD file, in the same folder as Excel.exe,
that says "Excel %1" and associate XLS files with this CMD file (use
the registry - otherwise you will upset Office as I have described
before) then... wait for it..

Excel behaves as a single instance application! Woohoo!
The only problem being that the CMD box appears and does not dissapear
until after you kill the Excel worksheet (although you can manually
kill the CMD box with no adverse side effects).

So, put that in your pipe and smoke it, Microsoft!
 
S

Sniq_e

Sorry peeps, forgot to specify...

You need a line such as:

"C:\Program Files\Microsoft Office\Office10\test.cmd" "%1"

as the associated program to the XLS file.

Does the trick for me!
 
S

Sniq_e

Jumping the gun a bit...
It almost works...
But I'm having a problem with the path... and a bit of a problem with
xls files (although .xxx files associated with my cmd work fine in the
right directory... very limited)... I'll get there soon and come back
to you when I've got it...

Surely somebody has attempted something like this before?
 
S

Sniq_e

OK, finally, I have a working system (with an unwanted CMD dos box).

I have created a CMD file called test.cmd and put it in the same folder
as Excel.exe... this is how mine reads:

echo off
CLS
echo Please feel free to close this window!
cd c:\progra~1\micros~2\office10\
Excel %1

Then, I deleted the XLS association.
Then, I created a new associaton for XLS and a new action, Open...
My entry now reads:

"C:\Program Files\Microsoft Office\Office10\test.cmd" "%1"

Finally, I have enabled the "Ignore other applications" checkbox in
Excel's settings... although this can be on or off and it still works.

And now, when I dbl-click on an XLS file (or an xls attachment), Excel
opens in a new instance, precisely how I want it to.

The only negative side effect that I have found is that I get a black
dos box at the same time (although this can be closed, easily)... I am
working on a way to make this disappear.

There is one final warning, if anybody else wants to follow in my
footsteps... I do not know if this process will stop Excel functioning
correctly in some specific instances (such as being invoked from within
a Word document)... so use this method with caution.

So, do I get a medal for being the first person to force Excel to
function as an SDI package... or do you all think that this is a
useless exercise?

Take care,
Andy
 
S

Sniq_e

Ammendment...


echo off
CLS
echo Please feel free to close this window!
c:\progra~1\micros~2\office10\Excel.exe "%~1"


Otherwise Excel does not open any files that are not on C: !!!!!
 
S

Sniq_e

Ammendment...
Batch file should read:

echo off
CLS
echo Please feel free to close this window!
c:\progra~1\micros~2\office10\Excel.exe "%~1"

Otherwise Excel will not open automatically on any drive other than c:
!!!

Oh, and I have added a strip the inverted commas and put them back
because... no, no reason... %1 is just as good as "%~1"

Good like screwing around with the way Windows works!
 
I

icee

thanks a lot for your work making excel2003 behave similar to word2003
i just didn't find the persistent .cmd-window ideal.
changing the batch file into the 1-liner:

start "" c:\progra~1\micros~2\office11\Excel.exe "%~1"

does the trick for me.

important are
1. the spaces after start and ""
2. omission of " around %~1 makes it impossible to open files wit
spaces in the file nam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top