Open Second Workbook Hidden?

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?
 
J

Jacob Skaria

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
 
N

Nancy Taylor

Perfect! I figured there had to be a way to save the workbook name and then
give it focus again.

Thanks so much!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top