> I can't get a lick of work done through the new UI
LOL... Lisa
Sent: Tue, Nov 27, 2012 3:29 pm
Subject: [ExcelVBA] Re: counter problem
I can't help with the priority issue per se (not having the newer versions 'cuz
I can't get a lick of work done through the new UI), but I can offer the
following code snippet using WMI to set process priority:
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colProcesses = objWMIService.ExecQuery("Select * from Win32_Process Where
Name = 'excel.exe'")
For Each objProcess in colProcesses
objProcess.SetPriority(256)
Next
This will work as either VBA or run as an external VBScript routine. WMI is a
wrapper for the Windows API calls that Paul is using. objWMIService.ExecQuery
always returns an array, so you have to use a For...Next loop to get or set a
parameter.
Priority Class Value:
Normal = 32
Low = 64
Real-time = 128
High = 256
Below Normal = 16384
Above Normal = 32768
~Hafizullah
(Just sitting at the corner of Awesome and Bombdiggity.)
[Non-text portions of this message have been removed]
Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (4) |
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.
----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA
----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com
----------------------------------
Tidak ada komentar:
Posting Komentar