Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default recognize USB drive


Is there a way to see if there is a USB memory stick connected to the PC
within a macro?


--
lcoreyl
------------------------------------------------------------------------
lcoreyl's Profile: http://www.excelforum.com/member.php...fo&userid=2042
View this thread: http://www.excelforum.com/showthread...hreadid=472292

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default recognize USB drive

Yes. create a small .bat file that attempts to do a DIR to the logical drive
unit. Run the .bat file thru a SHELL command from VBA. If you get back the
standard error message that the system could not find the path specified,
then the drive is not connected.
--
Gary''s Student


"lcoreyl" wrote:


Is there a way to see if there is a USB memory stick connected to the PC
within a macro?


--
lcoreyl
------------------------------------------------------------------------
lcoreyl's Profile: http://www.excelforum.com/member.php...fo&userid=2042
View this thread: http://www.excelforum.com/showthread...hreadid=472292


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default recognize USB drive


Gary''s Student Wrote:
Yes. create a small .bat file that attempts to do a DIR to the logical
drive
unit. Run the .bat file thru a SHELL command from VBA. If you get
back the
standard error message that the system could not find the path
specified,
then the drive is not connected.
--
Gary''s Student


"lcoreyl" wrote:


Is there a way to see if there is a USB memory stick connected to the

PC
within a macro?


--
lcoreyl

------------------------------------------------------------------------
lcoreyl's Profile:

http://www.excelforum.com/member.php...fo&userid=2042
View this thread:

http://www.excelforum.com/showthread...hreadid=472292



That won't work as different users will have different drive letters.
Is there a way to use the DIR function to find out what drives exist?


--
lcoreyl
------------------------------------------------------------------------
lcoreyl's Profile: http://www.excelforum.com/member.php...fo&userid=2042
View this thread: http://www.excelforum.com/showthread...hreadid=472292

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Links to mapped drive change to refer to local hard drive SueD Links and Linking in Excel 1 May 8th 08 11:42 AM
Can I save to hard drive AND my flash drive at the same time? Gizelle Excel Discussion (Misc queries) 3 July 24th 06 08:27 PM
Userform Local Drive & Network drive question Joel Mills Excel Programming 3 December 29th 04 10:43 PM
Pasting a range of information from a foler on F Drive to another folder on same drive Tom Ogilvy Excel Programming 1 August 3rd 03 01:50 AM
Find links with code; change from G drive to C drive Sandy[_3_] Excel Programming 4 July 26th 03 07:24 PM


All times are GMT +1. The time now is 06:29 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"