Av8tordude
Well-known Member
- Joined
- Oct 13, 2007
- Messages
- 1,075
- Office Version
- 2019
- Platform
- Windows
I have a code that inputs the HDD serial number in a text file, however when I run the code below to check if the HDD serial number matches the number in the text file, it gives an incorrect response. When I put the HDD serial number in a cell, the code response is correct. What am i missing?
Code:
Status = Trim(Split(f, vbCrLf)(2))
If Status = CreateObject("Scripting.FileSystemObject").GetDrive("C:\").SerialNumber Then
Msgbox "Yes"
Else
Msgbox "No"
End If
Last edited: