Excel =INFO(Directory) to find the Path for this workbook - Episode 1876
4,341 views · Published 9 April 2014 · 2:55 · Indexed 4 November 2026
Channel: MrExcel.com · 2014 · Education
Microsoft Excel Tutorial: Using INFO function in Excel to return worksheet Path. Welcome back to the MrExcel podcast. In this episode, we will be discussing a question that was posted on one of my old videos, podcast 1505. The question was about modifying code and receiving an error with the ActiveWorkbook.SaveAs function. Upon further inspection, I noticed that the code was missing a closing backslash. However, there may be a bigger issue at hand. Unless the user has specifically created a folder called C:\Desktop, the path is incorrect. So, how do we find the real path name? In this video, I will show you how to use the =INFO() function to find the real name of any given directory or folder. This function returns information about the current operating environment and is a useful tool for situations like this. But first, we need to figure out what the real path name is. This can be a bit tricky, as Windows Explorer only shows the name "Desktop" without the full path. So, here's my solution: simply save a file to the Desktop and use the =INFO() function to retrieve the full path. Once we have the full path, we can use it in our code instead of just pointing to "Desktop". This will ensure that the code works correctly, even if the user's Desktop path is different. It's a simple trick, but it can save you a lot of frustration. So, join me in this episode as we explore the =INFO() function and learn how to use it to find the real name of any directory or folder. Thank you for watching and don't forget to subscribe to the MrExcel podcast for more helpful tips and tricks. See you next time! Buy Bill Jelen's latest Excel book: https://www.mrexcel.com/products/latest/ You can help my channel by clicking Like or commenting below: https://www.mrexcel.com/like-mrexcel-on-youtube/ Table of Contents: (00:00) Question about Desktop folder (00:17) Explanation of issue (00:35) Real path name of Desktop (01:00) Using =INFO function (01:43) Obtaining actual path (02:02) Correct code (02:23) Using =INFO for any directory (02:40) Clicking Like really helps the algorithm #excel #microsoft #microsoftexcel #exceltutorial #exceltips #exceltricks #excelmvp #freeclass #freecourse #freeclasses #excelclasses #microsoftmvp #walkthrough #evergreen #spreadsheetskills #analytics #analysis #dataanalysis #dataanalytics #mrexcel #spreadsheets #spreadsheet #excelhelp #accounting #tutorial This video answers these common search terms: =INFO function ActiveWorkbook.SaveAs error Desktop folder name Directory information Episode 1876 Folder name INFO function trick Real path of desktop Windows Explorer Join the MrExcel Message Board discussion about this video at https://www.mrexcel.com/board/threads/1153700/ You want to use some VBA to save a file to the desktop. But what is the real path to the desktop? It is not C:\Desktop\. In this episode, an arcane function = INFO to return the path of the current workbook.
More from this channel
-
2:13
Excel Calculate Decimal Hours from two Time Cells - Episode 902
-
3:57
Excel 2007 - Color of Selected Sheets is too much like unselected sheets - Episode 907
-
2:48
Excel - Adding Equals Icon to Excel QAT - Build Formula with Mouse - Episode 911
-
3:30
Excel Grouping Percentages into Buckets for a Pivot Table - Method 2 - Episode 913
-
2:04
Excel Change Color of Selected Cells - Episode 914
-
4:38
Excel - Auto Numbering a List with Frequent Inserts & Deletes - Episode 916
-
2:00
Excel Hiding Data in Plain Site - Episode 919
-
2:20
Excel - Bring Back The Full Excel 2003 Dialogs In Excel! - Episode 920