How can I open 4 files with one click?

P

parzival

How can I open 4 files with one click?

I have
- my budget in one file (one sheet per year)
- my taxforecast / -returns in one file (one file per year)
- my salaryslip in one file (one file per year / raise :)
- my investment scheme in one file

All of these have referrals or links (don't know english term) between them.
e.g. both tax and budget files picks the monthly salary from the salary file.

Any ideas as how to open the (4) files with just one click?
I would prefer a method that allows me to have the same order (file 1, file
2, ..) every time.
 
D

Dave F

One possibility. In the options, under the general tab, you can specify a
folder, the contents of which open upon starting Excel.

Dave
 
D

Dave Peterson

Create a fifth workbook that opens the workbooks in the order that you want. It
would have a macro that ran each time excel opened this helper workbook.

Option Explicit
Sub auto_open()
Dim wkbk As Workbook
Dim myNames As Variant
Dim iCtr As Long

myNames = Array("C:\book1.xls", _
"C:\my firstfolder\book2.xls", _
"c:\my fifthfolder\book5.xls")

For iCtr = LBound(myNames) To UBound(myNames)
Set wkbk = Nothing
On Error Resume Next
Set wkbk = Workbooks.Open(Filename:=myNames(iCtr), UpdateLinks:=0)
If Err.Number <> 0 Then
MsgBox "Error opening: " & myNames(iCtr)
Err.Clear
End If
On Error GoTo 0
Next iCtr

'and when you're through testing uncomment this line
'remember to save first!
'ThisWorkbook.Close savechanges:=False
End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
Top