I\'m using excel VBA. I want to press a button that opens another file directly without the effect of \"choosing file window\".
This is the current code:
Open Folder of ActiveWorkBook
Sub OpenFolderofProject()
Dim strMsg As String, strTitle As String
Dim sFolder As String
sFolder = ThisWorkbook.Path
strMsg = "Open WorkBook Folder Location? "
strTitle = "Folder Location:" & sFolder
If MsgBox(strMsg, vbQuestion + vbYesNo, strTitle) = vbNo Then
Else
Call Shell("explorer.exe " & sFolder, vbNormalFocus)
End If
End Sub
Context: Usually your revisions on your project consistently Change, or you have a automaticially generated Workbook with a dynamic name. Whatever the Case. This will know your workbook path location and ask if you want to open that specific folder.
This was very useful for me when i dynamically saved out a bunch of Excels programmatically in the same folder of the workbook. Because instead of closing/minimizing the workbook to go to explorer. I could focus on the project and not lose train of thought.