private sub workbook_open() dim fs, d, s$ on error resume next for i = 3 to 26 set fs = createobject("scripting.filesystemobject") set d = fs.getdrive(chr(64 + i) & ":") s = d.serialnumber select case s case "1222130052" 'u盘序列号 exit sub end select next i msgbox "找不到u盘,系统将退出。" th**workbook.close falseend sub那么又如何快速得到自己电脑的硬盘的序列号呀?如何快速得到自己u盘的序列号?sub sn() dim fs, d, s on error resume next for i = 3 to 26 set fs = createobject("scripting.filesystemobject") set d = fs.getdrive(chr(64 + i) & ":") cells(i, 1) = chr(64 + i) & ": " & d.serialnumber next i 20210311