excel vba - Difference in path using ThisWorkbook/ActiveWorkbook -


i have 2 workbooks in same folder. execute macro one. code works properly, when change activeworkbook thisworkbook not working. error message path .../users/myuser/.... displayed, not place files storaged.

book2name = "workbook.xlsx" book2namepath = activeworkbook.path & "\" & book2name if isopen(book2name) = false workbooks.open (book2namepath) 

could explain m?


Comments

Popular posts from this blog

javascript - WinJS appendTextAsync producing scheduler errors -

minify - Minimizing css files -

Sockets with kotlin -