Open Second Workbook Hidden?

  • Thread starter Thread starter Nancy Taylor
  • Start date Start date
N

Nancy Taylor

I have a workbook that populates a drop down list from another master
workbook. I have been able to set up my workbook to open the master so that
the listboxes populate by using the workbooks.open function, but focus is on
the second workbook - which I don't want. Is there a way to open a second
workbook "hidden" or at least get the focus back on my first workbook?
 
Try the below macro...This will open book2.xls....but the activeworkbook will
remain active....If you are new to macros..

--Set the Security level to low/medium in (Tools|Macro|Security).
--From workbook launch VBE using short-key Alt+F11.
--From menu 'Insert' a module and paste the below code.
--Get back to Workbook.
--Run macro from Tools|Macro|Run <selected macro()>


Sub Macro()
Dim wb As Workbook
Set wb = ActiveWorkbook
Application.ScreenUpdating = False
Workbooks.Open "c:\book2.xls"
Application.ScreenUpdating = True
wb.Activate
End Sub

If this post helps click Yes
 
Perfect! I figured there had to be a way to save the workbook name and then
give it focus again.

Thanks so much!
 
Back
Top