Turn on/off the light attached to usb port through VBA

MBMSOFT

Registered User.
Local time
Today, 10:18
Joined
Jan 29, 2010
Messages
90
Enable and disable usb port ....
Is it possible enable and disable a usb port via vba?

An example of using this would be if I had a light plugged in a usb port and the code would turn it on and off.

Or maybe is there s some device like <PC-Some Device-USB light > which can be controled by vba
Thanks
 
Last edited:
Not unless you find a library in the references that has the right objects for manipulating device controllers.

But the easiest thing (if you really want to use VBA) is to look for a cmd command that does it and run it via the VBA.Shell() command. And I think that using WMI you can get the USB port names. However, I think that Powershell would be better for this sort of thing so consult the right forums.
 

Users who are viewing this thread

Back
Top Bottom