PDA

View Full Version : Excel Threads in Windows



Svmaxcel
09-15-2017, 11:17 AM
I had a small confusion in my mind as i am not able to understand Windows threads controller.
If i open multiple workbooks of excel in my system and if any one of them get freeze/Hang (due to calculation or while opening a bigger file or pasting huge set of data, etc..)
I have noticed 2 conditions several times that all excel workbooks freezes.
1) For examples I have a file named "A" opened and try to open a bigger file, for some seconds excel freezes every workbook.
2) For example I have a file named "A", "B", "C"opened and I am pasting huge data in File C.(File C will freezes for some seconds) but other 2 files still works properly.
What I think usually happens is when all excel workbook are opened using same threads if 1 will freeze all will freeze, but in case of different threads if 1 freezes others are still functional.

I checked Win Task Manager and found that sometimes there is 2 different task running excel and sometimes only 1 running excel, considering same numbers of excel file open.

My question is that how can I make excel file open in a different threads so that if 1 will freeze others will still work fine.

I am sorry if I was not able to explain properly.

mdmackillop
09-16-2017, 01:25 AM
Have a read of this (https://blogs.office.com/en-us/2013/06/03/opening-workbooks-by-running-separate-instances-of-excel/) and this thread (http://www.vbaexpress.com/forum/showthread.php?60682-application-windows-object&highlight=GetWorkbookByName)
From Excel, this should open the workbooks in separate instances

Sub test()
Shell ("excel.exe /x C:\VBAX\Book1.xlsx")
Shell ("excel.exe /x C:\VBAX\Book2.xlsx")
End Sub

Svmaxcel
09-16-2017, 02:35 AM
Thanks, by any chance does it affect the performance
Or does it affects copying pasting between 2 excel instances?

mdmackillop
09-16-2017, 04:43 AM
Thanks, by any chance does it affect the performance

I don't see that it should


Or does it affects copying pasting between 2 excel instances?
Yes. You can probably work around it in code but Ctrl C/V is affected.