When you open a workbook, it becomes by default the active workbook at that moment. So to know the directory of that active workbook, you can press Alt+F11 then Ctrl+G and type or paste ? activeworkbook.Path and press the Enter key.
If you want to know the path programmatically as you open the workbook, I would wonder why you'd not already know that, seeing as you'd have needed to know where the workbook was when you presumably navigated to some folder path in order to open it.