0

i am using a userform with commandbox whose list is populating from another workbook. i have tried several ways to get the list populated without opening the other workbook but its way too complicated. so i thought adding a button to the current workbook which would open the list source workbook in a minimized state could help.

i am using this code on the button click.

Sub Open_PriceList()
Workbooks.Open Filename:="F:\Document\Pricing\Price List.xlsx"
End Sub

is there anyway i could open the file in minimized state?

Community
  • 1
  • 1
Ahmed
  • 117
  • 2
  • 12
  • 1
    Check out [this](http://stackoverflow.com/questions/579797/open-excel-file-for-reading-with-vba-without-display) – Scott Craner Nov 22 '15 at 19:39
  • great idea @ScottCraner. OP, beware of early-binding in the answer to that post. I didn't see it notified in the answer (or anywhere). – Scott Holtzman Nov 22 '15 at 20:41
  • I do not want to close the file. Just want to minimize it. if i close the file then the list would not populate anymore – Ahmed Nov 22 '15 at 22:44

1 Answers1

0

You can try this:

Sub Open_PriceList()
Workbooks.Open Filename:="F:\Document\Pricing\Price List.xlsx"
ActiveWindow.Visible = False
End Sub
MGP
  • 2,480
  • 1
  • 18
  • 31