You have:
Code:
sDevice = "\\?\usb#vid_0765&pid_" & device & "#******#{" & PRIVATE_IID_STR & "}"
I'm curious about where and how you delcared "device".