NdNoviceHlp
Well-known Member
- Joined
- Nov 9, 2002
- Messages
- 3,636
Determining if OneDrive exists on a pc seems like it would be fairly straight forward with something like this...
Not so much. It "seems" to work on newer versions of Windows both connected and not connected to the net, but for my old Vista version that's not connected to the net (if that matters?), it returns "OneDrive is Available 8" (8 is the Len of the Dir return). The problem is that there is no OneDrive on my old Vista Windows pc. I also trialed using the file system objects with .driveexists, folderexists, etc. without any Vista success. You can determine from the registry if OneDrive exists but I would prefer to either use a filesystem object, DIR or something else if anyone has any suggestions. Thanks for your time. Dave
Code:
Sub T1Drv()
'test for onedrive
Dim FLName As String
FLName = Environ("OneDrive") & "\"
If Len(Dir(FLName, vbDirectory)) = 0 Then
MsgBox "No OneDrive Available " & Len(Dir(FLName, vbDirectory))
Else
MsgBox "OneDrive is Available " & Len(Dir(FLName, vbDirectory))
End If
End Sub