maverick93
New Member
- Joined
- Jan 7, 2010
- Messages
- 23
I need some help creating a short cut to a folder using VBA.
I have a command button that creates two folders, the first is the folder where the workbook is being saved and the second is another folder that is saved in an entirely different spot.
I would like to create a shortcut to this second folder in the first folder (the same place the workbook is saved).
Thanks for the help!
I have a command button that creates two folders, the first is the folder where the workbook is being saved and the second is another folder that is saved in an entirely different spot.
I would like to create a shortcut to this second folder in the first folder (the same place the workbook is saved).
VBA Code:
Private Sub CommandButton2_Click()
' Create a Quote folder
MkDir Left(Application.ThisWorkbook.Path, InStr(Application.ThisWorkbook.Path, "FORMS") - 1) & Sheets("Data").Range("E2") & " -- #" & Sheets("Data").Range("E1") & " -- " & Sheets("Data").Range("E3")
'Saves the file in the Quote folder
ActiveWorkbook.SaveAs Filename:= _
Left(Application.ThisWorkbook.Path, InStr(Application.ThisWorkbook.Path, "FORMS") - 1) & Sheets("Data").Range("E2") & " -- #" & Sheets("Data").Range("E1") & " -- " & Sheets("Data").Range("E3") & "\Taper Cut List & Drawing - V1 -- " & Sheets("Data").Range("E2") & " -- #" & Sheets("Data").Range("E1") & ".xlsm" _
, FileFormat:=xlOpenXMLWorkbookMacroEnabled, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
' Create a new TAPERPLUS folder
MkDir "C:\Users\" & Environ("username") & "\" & Mid(Application.ThisWorkbook.Path, InStr(Application.ThisWorkbook.Path, "Dropbox"), InStr(Application.ThisWorkbook.Path, "LJS") - InStr(Application.ThisWorkbook.Path, "Dropbox")) & "TAPERPLUS\" & Right(Application.ThisWorkbook.Path, Len(Application.ThisWorkbook.Path) - Len(Left(Application.ThisWorkbook.Path, InStr(Application.ThisWorkbook.Path, "Offs\") + 4))) & Sheets("Data").Range("E27").Value & ".DIR\"
'Create a Shortcut of the New TAPERPLUS folder in The Quote folder
'???????? Not sure what that code should be
End Sub
Thanks for the help!