This function gathers all the drive letters on a USB drive. It is reporting a bad File Name at Line 90 anyone know why ?
Code:Function BackUpBidFoldersDrive() As String Dim UsbDriverLetters() As String Dim DriveLetterToUse As String Dim counter As Integer Dim i As Integer Dim UsbDriveLetter As String Dim TmpDriveLetter As String Dim CdFlashDriveLetter As String Dim freespace As Double 'Long Dim MostSpace As Double 30 On Error GoTo e 40 counter = 0 50 For i = 65 To 90 60 If DriveType(Chr$(i)) = "removeable" Then 70 If Chr$(i) <> "A" Then 'A shows as removal also counter = counter + 1 80 TmpDriveLetter = Chr$(i) 90 ReDim Preserve UsbDriverLetters(counter + 1) 'error here UsbDriverLetters(counter) = Chr$(i) & ":\" End If End If Next i





Reply With Quote