Save workbook To any USB Drive no matter what drive letter
Try this user defined macro code assigned to a button and once it works for
you simply put your saving code in place of the msgbox code.
Sub Get_Drive_Info()
On Error Resume Next
Dim i As Integer
Set fs = CreateObject("Scripting.FileSystemObject")
For i = 67 To 90
Set drspec = fs.GetDrive(Chr(i))
If drspec.drivetype = 1 Then
MsgBox "Drive " & Chr(i) & " is the removable drive"
i = 90
End If
Next i
End Sub
"pano" wrote:
Hi all, I have tried the search and cannot get any of the other VBA
macros to work re this subject!!
I want to be able to press a button on a sheet on my workbook and have
a macro save the workbook to a USB drive which could come up as either
drive D - E or F. No prompts just save a copy.
Any help at all would be appreciated immensely as I dont have a clue
re VBA. I'm sure that someone must have code that works.
This is the last thing I need to complete the project.
Thanks in advance
Stephen
|