Desktop shortcut to last file that was opened

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to find a way to create a desktop shortcut that will open the last
Excel file I was working on. I have a one for Word but have not been able to
create one for Excel. Does anyone have any suggestions
 
How did you do this in MSWord? I would have guessed that there wasn't a way.

=====
This may work for you in excel.

It doesn't open the last file that you were working on--but it will open the
first file in the Most Recently Used File list (if you have that turned on).

I'd create a new workbook and put this code in a general module:

Option Explicit
Sub auto_Open()
Dim wkbk As Workbook

Set wkbk = Nothing
On Error Resume Next
Set wkbk = Workbooks.Open(Filename:=Application.RecentFiles(1).Path)
On Error GoTo 0

If wkbk Is Nothing Then
MsgBox "Most Recently used file not opened!"
End If

'uncomment this when you're sure it's working ok
'ThisWorkbook.Close savechanges:=False

End Sub

Then put a short cut to this "helper" workbook on your desktop.


If the file has been deleted/renamed/moved, then this will fail.

If you don't have (xl2003's menu):
Tools|Options|General tab|Recently Used File list
turned on, then it will fail.
 
Hi,

You can try the other way too.

Add an open file to the Favorites folder

You can add an open file to the Favorites folder so that you can easily
reopen it later. You must save the file before performing this procedure.

1. If the Web toolbar (toolbar: A bar with buttons and options that you use
to carry out commands. To display a toolbar, click Customize on the Tools
menu, and then click the Toolbars tab.) is not displayed, point to Toolbars
on the View menu, and then click Web.

2. On the Web toolbar, click Favorites, and then click Add to Favorites.
3. Click Add.

Challa Prabhu
 
For MSWord shortcut:

Create a desktop shortcut for Winword.exe; open the properties and in the
Target bar go to the end of the file path leave a space then type /mFile1.
Now when you click on the shortcut it will open the last document you had
open.

Thanks, and I'll try your code.
 
Thank you

challa prabhu said:
Hi,

You can try the other way too.

Add an open file to the Favorites folder

You can add an open file to the Favorites folder so that you can easily
reopen it later. You must save the file before performing this procedure.

1. If the Web toolbar (toolbar: A bar with buttons and options that you use
to carry out commands. To display a toolbar, click Customize on the Tools
menu, and then click the Toolbars tab.) is not displayed, point to Toolbars
on the View menu, and then click Web.

2. On the Web toolbar, click Favorites, and then click Add to Favorites.
3. Click Add.

Challa Prabhu
 
I looked at the help in MSWord (2003) for "customize how word starts".

It says this:
/m
Start Word without running any AutoExec macros.

/mmacroname
Start Word and then run a specific macro. The /m switch also prevents Word from
running any AutoExec macros.

Example: /mSalelead

So it kind of looks like you have a macro (in normal.dot????) that runs when you
use that shortcut. You may want to look at that macro to see if it can be
converted to excel (or if it's close to the suggested code).
 
Back
Top