Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove PERSONAL.XLSB file from RecentFiles List?? 1

Status
Not open for further replies.

kjv1611

New member
Jul 9, 2003
10,758
US
This is something that's just bothered me since Excel 2007. If you have the PERSONAL.XLSB (or PERSONAL.XLS prviously) file set to start with your workbook, it always shows in the recent files list, in recent documents (start menu), etc.

Before Excel 2007, I never had this issue - the file was opened and never showed in recent docs.

I've played around a little with looking at Application.RecentFiles, but when I do a Debug.Print on looping through them, I do not see the PERSONAL.XLSB file at all.

So, does anyone know of a method or a property I can use for getting rid of PERSONAL.XLSB from showing in Recent history?

To me, it seems just plain silly or annoying, depending upon my mood, I suppose. [smile]
 
A starting point:
Dim R As String, P As String
R = Environ("USERPROFILE") & "\Recent\"
P = Dir(R & "PERSONAL.XLS*")
If P <> "" Then Kill R & P

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hmm... Thanks, I didn't even consider the Environ function for finding anything..

Thanks, I'll take a look.
 
I could be wrong, but it's looking to me like Windows or Office has somethign done to that file that just doesn't allow anything to be done to it via VBA/code. I am able to manually delete the file, but can't rename the file, so not sure if that has anything to do with it.

Also, the full path for the file is:
C:\Users\MyName\Recent\PERSONAL.XLSB[BLUE].lnk[/blue]

Environ("USERPROFILE") works correctly.

On the Dir() line, I'm getting the error, "Run-time error '52': Bad file name or number...

I'm assuming it's a formatting issue there, maybe...

So I tried just a static line:
Kill "C:\Users\MyName\Recent\PERSONAL.XLSB.lnk"

And on that line, I got this error:
Run-time error '53':
File not found.

That makes me think it's just not going to work, b/c of possibly some file protection setting.. but that's still just a guess.

Thanks again for giving me another idea, though.. seems surely I'll find an complete answer before long. [wink]
 
Well from all the testing I've done now, using the Environ,Dir,Kill stuff, and using the FileSystemObject, and even trying to just use a Windows batch file with the command, DEL, it looks like Windows just has the Recent folder locked down.

For instance, I couldn't even list all the files in the folder using DIR in a command prompt... even with "run as administrator"

If I CD to the folder, and then type DIR, I get this:

Volume in drive C has no label
Volume Serial Number is...

Directory of C:\Users\mname\Recent

File Not Found


Any thoughts/ideas as to how to get around that restriction?

In case it makes a difference, I'm using Windows 7.. well, I guess I could end up needing to ask it in the windows 7 forum... I'll wait for any replies here first..
 
and then type DIR
what about this ?
DIR /A

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Same thing. Must be something with the login settings at work, perhaps?
 
Never found a real solution on this one so far, by the way... though I've not looked at it for a few days at least.

If I remember, I'll try at home to see whether it's some file and folder settings at work preventing it or whether it's something by Microsoft.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top