Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a way to determine what drive is assigned to my memory stick.
Instead of having to "explore", then drag and drop my spreadsheets between my computer and memory stick, I want to use a command button to save it to the memory stick. Thanks, Les |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Double-click My Computer
-- Gary''s Student - gsnu200767 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ok, maybe I was not clear enough. I want to know if there is a code in VBA
(Excel) that can automatically determine what drive letter is assigned to the memory stick so when I click the command button (Caption="Save To Memory Stick"), it will know what drive to send it to. Les "Gary''s Student" wrote: Double-click My Computer -- Gary''s Student - gsnu200767 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
See:
http://groups.google.com/group/comp....dbc9d3de889e96 I have not used any of this code. -- Gary''s Student - gsnu200767 "WLMPilot" wrote: Ok, maybe I was not clear enough. I want to know if there is a code in VBA (Excel) that can automatically determine what drive letter is assigned to the memory stick so when I click the command button (Caption="Save To Memory Stick"), it will know what drive to send it to. Les "Gary''s Student" wrote: Double-click My Computer -- Gary''s Student - gsnu200767 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You could search the *scripting* newsgroups via google:
I found this post: http://groups.google.co.uk/group/mic...90dbdfcb919660 That pointed to: http://groups.google.co.uk/group/mic...9?dmode=source and http://groups.google.co.uk/group/mic...2?dmode=source WLMPilot wrote: Is there a way to determine what drive is assigned to my memory stick. Instead of having to "explore", then drag and drop my spreadsheets between my computer and memory stick, I want to use a command button to save it to the memory stick. Thanks, Les -- Dave Peterson |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"Dave Peterson" wrote:
You could search the *scripting* newsgroups via google: .... That pointed to: http://groups.google.co.uk/group/mic...9?dmode=source and http://groups.google.co.uk/group/mic...2?dmode=source WLMPilot wrote: Is there a way to determine what drive is assigned to my memory stick. Instead of having to "explore", then drag and drop my spreadsheets between my computer and memory stick, I want to use a command button to save it to the memory stick. I think that sample code does not distinguish between memory sticks and external disks. Maybe it would be simpler to rename the memory stick (if possible) and check for volume name, something like this: Set fso = CreateObject _ ("Scripting.FileSystemObject") Set colDrives = fso.Drives For Each objDrive In colDrives If objDrive.IsReady Then If objDrive.VolumeName = "MYUSBDRIVE" Then Debug.Print objDrive.Path, _ objDrive.VolumeName, _ objDrive.DriveType End If End If Next or using WMI: Set WMI = GetObject _ ("WinMgmts:Root\Cimv2") Set colLogicalDisks = WMI.ExecQuery _ ("Select * From Win32_LogicalDisk " & _ "Where VolumeName = 'MyUSBDrive'") For Each objLogicalDisk In colLogicalDisks Debug.Print objLogicalDisk.DeviceID, _ objLogicalDisk.VolumeName, _ objLogicalDisk.Description Next -- urkec |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Links to mapped drive change to refer to local hard drive | Links and Linking in Excel | |||
Import from MS Access - Lose the drive letter..link only to drive | Excel Programming | |||
Determine the USB drive | Excel Programming | |||
Windows API to Determine if File is Local/Convert Path to Drive Letter | Excel Programming | |||
Determine cells that drive conditional formatting? | Excel Discussion (Misc queries) |