Ok so I am almost there... I just don't understand how to change the file path to a local drive.
I understand that the following bit of code is scanning the drives and looking for a USB drive. Once found, it assigns the drive letter to MyDrive2. MyDrive2 is then used in the second bit of code to assign the file location.
Since I will save locally, for instance to "C:\Users\XXXXX\Desktop\Machining Quotes", I do not need to scan for a USB drive (perhaps just scan to make sure that folder is present?) how do I change the value of MyDrive2 to the file path of the folder I am saving to? or is there a different method for this?
Thank you for all of your help thus far.
Set FSO = CreateObject("Scripting.FileSystemObject")
For Each Drv In FSO.Drives
With Drv
If .IsReady And .DriveType = 1 Then
decision = MsgBox("Detected USB Removable storage device in drive " & .DriveLetter & vbCrLf & "Do you wish to continue ?", vbQuestion + vbYesNo, "Save ?")
If decision = vbNo Then Exit Sub
MyDrive2 = .DriveLetter
GoTo SaveRoutine
End If
End With
Next Drv
MsgBox "No USB Removable storage devices found", vbInformation
Exit Sub
Sheet4.ExportAsFixedFormat Type:=xlTypePDF, Filename:=MyDrive2 & ":\" & tbl1.Range(a, 2) & " " & Format(Now(), "MM-DD-YYYY") & ".pdf", Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
Bookmarks