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?
 

Some videos you may like

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

RalphA

Well-known Member
Joined
May 14, 2003
Messages
3,829
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...
 

JH

New Member
Joined
Nov 23, 2005
Messages
16
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.



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.



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



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
 

RalphA

Well-known Member
Joined
May 14, 2003
Messages
3,829
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!
 

JH

New Member
Joined
Nov 23, 2005
Messages
16
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,119,128
Messages
5,576,253
Members
412,709
Latest member
Rishu
Top