Default path to the History folder

JH

New Member
Joined
Nov 23, 2005
Messages
16
When an Excel file is created, a link to that file is automatically created in Excel's History folder. However, when an Excel file is deleted, the corresponding "LNK" file is not deleted. Using VBA to delete those "dead links" in various OSes, a default history path for each particular OS is needed. I'm using several lines of code that work, but I wonder is anyone knows if there is a one code would generate the default path to Excel's History folder?
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
I have searched for files with the .lnk extension, and, what I have found, are the paths and filenames for .xls files These files are scattered in many different locations, or paths. However, if one does a right click on any of the correxponding icons, then chooses Properties, the particular name and path ae shown.

Perhaps you could post an example for, say, Book1.xls, which exists in everybody's computer, explaining where the .lnk file is located? With this information, many of us might try...and some succeed...in coming up with a solution. It might be worth a try...
 
Upvote 0
I'm running Excel 2000 in Win 98Se. When the user selects "File|Open" in Excel,
the Open dislog box displays several locations for possible files. One of the
locations is Excel's "History" folder. This folder contains links to files opened
previously opened in Excel.

Book1.gif


In Win 98Se, the path of this folder is

"C:\WINDOWS\Application Data\Microsoft\Office\Recent".

Clicking on "Recent" in the dialog box, one can see the path.

Book2.gif


Examining the structure of the path in Win 98, one finds the "links" in the "Recent" folder.

Book3.gif


In Xp, the path is different, yet similar because the files are in the path
"C:\ [varies] \Application Data\Microsoft\Office\Recent".

This is the "default path" I would like to know. Something simple,
like "a = Application.HistoryPath" or "a = Application.RecentPath".

Currently, I am having to use the "default template path" along with string
length and left string functions to create a path to this "History" folder. The code is displayed below.

a = Application.TemplatesPath
b = Len(a) - 10
a = Left(a, b)
a = a & "Office\Recent\*.lnk"
Kill a

Thanks,
JH
 
Upvote 0
JH, WOW! You came back loud and clear!

I have Microsoft Office 97, running on Windows XP, Home Edition, w/ Service Pack 2. Unfortunately, I cannot only find any "History" folder, I cannot find any "Recent" folder, either.

The "recent" files are shown at the bottom of the Main Menu's dropdown "File". But, I'm afraid that's the only place that I know where the "recent" files are shown thus.

And, I'm afraid that you are looking for a VBA solution, in which I am not knowledgeable, so, it will have to be another that will help you in this. I'm sorry, and, good luck!
 
Upvote 0
Thanks for the response, Ralph.

In reality, the VBA snippet of code I seek may not exist. However, I will leave the gifs up for a few days in case some user stumbles across my message with a solution.
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,198
Members
449,072
Latest member
DW Draft

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top