I want my macro to Save the workbook onto my USB E:\ drive, if I have it plugged in;
what is the syntax for the condition "If E:\ is available"... or "If USB exists"... ?
Thanks for any help.
AC
I want my macro to Save the workbook onto my USB E:\ drive, if I have it plugged in;
what is the syntax for the condition "If E:\ is available"... or "If USB exists"... ?
Thanks for any help.
AC
Last edited by aca; 06-17-2020 at 11:42 AM.
If you are only checking drive exists or not...
Something like below.
EDIT: DriveCheck() returns True if drive exists. So you can use that in your If statement. Also note that this only works for Windows based system.Please Login or Register to view this content.
Last edited by CK76; 06-17-2020 at 12:04 PM.
?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
― Robert A. Heinlein
Other ways : just managing the Dir VBA function or searching for the volume name rather than the drive unit …
Last edited by Marc L; 06-17-2020 at 12:27 PM.
Thank you, CK76; in fact, what I want is to go on and save my file onto the USB, if I have it plugged-in.
I'm not sure I'll know how to use all that code as just the condition for saving or not (or ending the macro).
ACA
Thank you, Marc L. The fields you mention, Dir VBA and Volume name, are both new to me; I'll explore them.
ACA
Something like...
Please Login or Register to view this content.
Oh, oh... thank you very, very much, CK76! This is exactly what I need.
ACA
You are welcome and thanks for the rep
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks