Wizard
12-11-2005, 08:23 PM
Situation: Using Excel 2000 to control another program (IBM Personal Communications) to communicate with our mainframe, and while the connecting (as an Object, named "PComm" for this thread) & sending commands is no problem, I just have difficulty letting go. No, this is not better suited for 'Dear Abby'...
When the job is complete, I use a "Set PComm = Nothing" command to release the object.
Now... this works absolutely fine on my computer with Personal Communications v5.6, but my company is upgrading the computers it will be used on to (very nice) hyperthreaded machines with Personal Communications v 5.7.
On the new machines, the first time Personal Communications is accessed, it works perfectly. The next time, however, it (PComm) hangs when the VBA procedure tries to link with Personal Communications. It hangs hard, too - I have to go into Task Manager & end the tasks (both PComm & Excel, which won't do anything while waiting for the linkup), then go to the next tab & kill the PComm processes - there are 2 sets of them at that point. Either that or reboot. Then start everything back up, and it will work perfectly again - once.
I've tried a number of ways around this in VBA, but so far I have had no luck.
I have researched this and found that it is apparently caused by a combination of the hyperthreading capabilities of the new machines and the software, which causes a DLL to not unload properly. From the IBM site http://www-1.ibm.com/support/docview.wss?rs=180&uid=swg1IC39146 (http://www-1.ibm.com/support/docview.wss?rs=180&uid=swg1IC39146):
After a VBScript macro is played in a PCSWS process (pcomm
session), the EHLLAPI dll, pcshll32.dll, is not getting
unloaded. When one of the PCSWS processes is closed, the dying process sets a variable to False in pcswlib.dll. Later when the same PCSWS process unloads all the dlls, pcshll32.dll is also unloaded during which it waits for this same value to be set to True. This causes a deadlock and results in PCSCM as well as other PCSWS processes to hang.
Though admittedly the problem they describe elsewhere on that page isn't exactly what we are experiencing, it is similar enough to lead me to believe this is the issue.
One fix suggested on that site is to disable the hyperthreading in the BIOS on the machines in question. I think this would be simple enough to do on one machine to show whether or not we're barking up the right tree, but of course, I would have to climb pretty far up IT's... tree to get that done.
The other is to update the software. This is a global $8+Billion (sales) company and while I have turned that over to the IT department, things like this in a company this size can tend to move slowly. I don't have that kind of time.
As, at least, a temporary fix/workaround, what I need to be able to do is to programmatically kill the processes for PComm, forcing the application to close. The user would then have to restart that application & re-log in, but that's a lot less painful than rebooting, and a lot less risky than teaching the users to muck about killing processes thru Task Manager.
I've had the suggestion to initialize a variable as a process, so I could then get the open processes and close the appropriate ones, but the object library thing that allows me to Dim a variable as a Process is missing, apparently. Or maybe I just haven't been able to find it....
Clues, anyone?
: pray2:
When the job is complete, I use a "Set PComm = Nothing" command to release the object.
Now... this works absolutely fine on my computer with Personal Communications v5.6, but my company is upgrading the computers it will be used on to (very nice) hyperthreaded machines with Personal Communications v 5.7.
On the new machines, the first time Personal Communications is accessed, it works perfectly. The next time, however, it (PComm) hangs when the VBA procedure tries to link with Personal Communications. It hangs hard, too - I have to go into Task Manager & end the tasks (both PComm & Excel, which won't do anything while waiting for the linkup), then go to the next tab & kill the PComm processes - there are 2 sets of them at that point. Either that or reboot. Then start everything back up, and it will work perfectly again - once.
I've tried a number of ways around this in VBA, but so far I have had no luck.
I have researched this and found that it is apparently caused by a combination of the hyperthreading capabilities of the new machines and the software, which causes a DLL to not unload properly. From the IBM site http://www-1.ibm.com/support/docview.wss?rs=180&uid=swg1IC39146 (http://www-1.ibm.com/support/docview.wss?rs=180&uid=swg1IC39146):
After a VBScript macro is played in a PCSWS process (pcomm
session), the EHLLAPI dll, pcshll32.dll, is not getting
unloaded. When one of the PCSWS processes is closed, the dying process sets a variable to False in pcswlib.dll. Later when the same PCSWS process unloads all the dlls, pcshll32.dll is also unloaded during which it waits for this same value to be set to True. This causes a deadlock and results in PCSCM as well as other PCSWS processes to hang.
Though admittedly the problem they describe elsewhere on that page isn't exactly what we are experiencing, it is similar enough to lead me to believe this is the issue.
One fix suggested on that site is to disable the hyperthreading in the BIOS on the machines in question. I think this would be simple enough to do on one machine to show whether or not we're barking up the right tree, but of course, I would have to climb pretty far up IT's... tree to get that done.
The other is to update the software. This is a global $8+Billion (sales) company and while I have turned that over to the IT department, things like this in a company this size can tend to move slowly. I don't have that kind of time.
As, at least, a temporary fix/workaround, what I need to be able to do is to programmatically kill the processes for PComm, forcing the application to close. The user would then have to restart that application & re-log in, but that's a lot less painful than rebooting, and a lot less risky than teaching the users to muck about killing processes thru Task Manager.
I've had the suggestion to initialize a variable as a process, so I could then get the open processes and close the appropriate ones, but the object library thing that allows me to Dim a variable as a Process is missing, apparently. Or maybe I just haven't been able to find it....
Clues, anyone?
: pray2: