View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
[email protected] pfsardella@yahoo.com.nospam is offline
external usenet poster
 
Posts: 172
Default Open workbook without activating it

Sub OpenNoActivate()
Dim wBk As Workbook

Set wBk = ActiveWorkbook
Application.ScreenUpdating = False
Workbooks.Open FileName:="YourFileName"
wBk.Activate
Application.ScreenUpdating = True

End Sub

Tested using Excel 97SR2 on Windows 98SE,

HTH
Paul
--------------------------------------------------------------------------------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------------------------------------------

First: I am not much of a VBA coder. Usually, I record a macro and
edit it slightly.

I would like to create a macro that opens a specific workbook without
making it the active workbook. I'd like it to be transparent to the
user. Since this is going in a template, the user may not have saved
his current workbook, so I can't just switch back to a specific
workbookname.

Any ideas?