I guess I wasn't clear. When I open Excel I want it to show the last
document that I had open when I last closed Excel. I don't want to have to
go to files and select the most recent file.
I'm not sure I would have used book.xlt. This is the template file that excel
uses whenever you click on that New icon on the standard toolbar (and the
template that is used when excel starts up).
It'll do what you want, but each workbook that is created that is based on this
template file will have that macro in it. That means whenever you open one of
those files, the first file on that MRU list will be opened.
And if you share any of these workbooks with others, then those users will get
that macro, too.
I think I'd either put it in my Personal.xls file (also stored in XLStart) or a
dedicated workbook (Named OpenMRU.xls (?)) stored in that same XLStart folder.
If you use the dedicated workbook, you could modify Dana's code so that the
workbook closes itself, too:
Sub Auto_Open()
Application.RecentFiles(1).Open
Thisworkbook.close savechanges:=false
End Sub
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.