the code I have currently opens a specific file instead of the last saved file. This file will be open by different users with the same file path names. I don't want to use the file name detailreport (22) because each time the number increases by one when saved. The VBA code needs to find the last saved file because the number will always increase by 1. And once it opens the path to the Downsloads folder. I need the folder to close.
VBA Code:
Sub HRIS()
'
' HRIS Macro
'
'
Dim strUser As String
strUser = Environ("username")
Shell "explorer C:\Users\" & strUser & "\downloads"
Workbooks.Open fileName:= _
"C:\Users\hello1234\Downloads\DetailReport (22).xls"
Rows("1:1").Select
Selection.Delete Shift:=xlUp
Rows("1:1").Select
Selection.RowHeight = 33.75
Windows("Org Chart.xlsm").Activate
End Sub