What is the equivalant of App.Path in VBA programming with Excel? I've tried Me.Path inside the ThisWorkbook module, even tried Workbooks(1).Path but they all return vbNullString.
Printable View
What is the equivalant of App.Path in VBA programming with Excel? I've tried Me.Path inside the ThisWorkbook module, even tried Workbooks(1).Path but they all return vbNullString.
Sub a()
MsgBox ThisWorkbook.Path
End Sub
or activeworkbook.path
You can also use....
Code:Set objExcel = CreateObject("Excel.Application")
Set oXLApp = objExcel.Workbooks.Open(FileName:=App.Path & "\" & "Book1.xls")