View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Opening another file in background

Sub test()
Dim wb As Workbook, wn As Window
Dim sFile As String
sFile = "path_and_filename.xls"
Application.ScreenUpdating = False
On Error Resume Next
Set wb = Workbooks.Open(sFile)
If Not wb Is Nothing Then
For Each wn In wb.Windows
wn.Visible = False
Next
End If
On Error GoTo 0
Application.ScreenUpdating = True
End Sub

Perhaps it would be better if you save your file as 'hidden' in the first
place

Regards,
Peter T

"Patrick Simonds" wrote in message
...
I have an Auto_Open macro in which I want to have
O:\PT_DRIVER_SCHED\Templates\EmployeeList.xls open in the background
without losing focus on the current workbook.