LeonardSterk
New Member
- Joined
- Mar 21, 2021
- Messages
- 33
- Platform
- Windows
Hello,
I had a working macro that would open the most recent excel file. I made this macro at home for work. Now it turns out that this macro doesn't work at my work because we don't have permission to do this
The macro says we don't have permission, and no, I'm can't/not allowed to change permissions
Anyone know some alternative code to find the most recent file in D:\Pro\Files\ ?
I had a working macro that would open the most recent excel file. I made this macro at home for work. Now it turns out that this macro doesn't work at my work because we don't have permission to do this
The macro says we don't have permission, and no, I'm can't/not allowed to change permissions
VBA Code:
Sub Open()
Workbooks.Open Split(CreateObject("WScript.Shell").Exec("cmd /c dir /b/o-d/s D:\Pro\Files\*.xls*").StdOut.ReadAll, vbCr)(0)
End Sub
Anyone know some alternative code to find the most recent file in D:\Pro\Files\ ?