PDA

View Full Version : [SOLVED:] Multiple Instances of Excel



Cyberdude
09-15-2005, 11:17 AM
The post by v_gyku brought up the subject of multiple instances of Excel executing. When I've asked about why I get messages about a workbook being shared by someone so I can't update it, the responses often refer to the possibility of there being multiple instances of Excel executing. I don't understand how you can ever get multiple instances of Excel executing. Why and how would a second or third be initiated?? :bug:

mvidas
09-15-2005, 12:35 PM
Hey CD,

How: Open excel however you would normally open it (start/programs/excel or whatever). Do that again. Do that again. Now you have 3 instances open.

Why: Sometimes if I'm running code that takes a lot of time (lot of web queries or db queries, etc) I'll open up a separate instance of excel to run it. That way, the code can run until its done, and I can still have my main one to use as I please. The extra instances have read-only access to personal.xls, which is why I use these to run code, and I can update my personal.xls as needed. Other people may have other reasons, thats really the only reason I ever use it. Some people may purposely create a new instance programatically (from outside excel) so they can close it and clear memory without having to worry about closing a user's already-open instance.

Matt

TonyJollans
09-15-2005, 12:44 PM
Also, Excel has some built-in limits because it does some of its own memory management. It's not so bad in 2003 but in earlier versions, running multiple instances could be a way to get over some problems.

Cyberdude
09-15-2005, 02:37 PM
I guess I'm still confused. I just opened 3 workbooks one after the other, and the Task Mgr showed Microsoft Excel only once. Perhaps I don't understand what you mean by "starting Excel". To me Excel starts as a result of opening a workbook. What am I missing??

TonyJollans
09-15-2005, 03:57 PM
If you follow Matt's instructions - explicitly start Excel (from the Windows Start menu) without a workbook (or, rather, with a blank new one) - you will get multiple instances. If you open an existing workbook, Windows looks for an existing instance of Excel to use to open the workbook and only starts a new one if there isn't one already.

MOS MASTER
09-15-2005, 04:01 PM
Excel like Word is a MDI (Multiple Document Interface) which means you can start more windows within the same Excel Instance. (So only one process)

Starting Excel from the Start | programs shortcut (Or any other to the excel.exe file) wil start a new instance of the program. (Also in taskmanager)

HTH, :whistle:

Ivan F Moala
09-15-2005, 10:15 PM
Excel like Word is a MDI (Multiple Document Interface) which means you can start more windows within the same Excel Instance. (So only one process)


HTH, :whistle:

I think you have that mixed up in that Excel like Word (and Access) default to
SingleUse Instancing. (OutLook & Powerpoint are MultiUse Instancing)
SingleUse instancing causes a new instance of the application to launch i.e. when calling Excel via the CreateObject your Client application references a separate copy of Excel. Try this via code OR manually eg. Start > Excel ? then again,
you will get 2 instances of Excel running. Now try with OutLook, whilst it may show 2 instances in your Taskbar both instances are acting on the same Data eg. Deleting messages to the delete folder also does this to the other ?instance?

MultiUse instancing on the other hand allows for multiple clients to share the same server application as in OutLook.

so it DOESN'T "start more windows within the same Excel Instance"

Cyberdude
09-16-2005, 12:58 PM
Thanx, Guys. I really think I understand it now. It never occurred to me to start another instance, so I was unfamiliar with what happens. That explains a lot of things. Thanx again.