I am having a problem with the initial part of a project I'm developing. As the whole project is a bit big I will try to be the most specific I can.
So, here is my problem. I have a Workbook called Plano Mestre de Produção Fibralit DCF-09, with a worksheet containing a 28 columns simple table, and a module which is carrying all the code. I also have another Workbook called Banco de Dados Produção Fibralit, a database kind of workbook, which will absorb and read some of the information during the code process.
I created two Multiselect Listbox that will be filled with some data based on some parameters. Those listbox will read the data from the Plano Mestre de Produção Fibralit DCF-09 workbook, which will be always open as it holds the code, and from the Banco de Dados Produção Fibralit workbook. The second, however, will be closed at all the time, and should only be opened to help fill the listbox and then closes again.
The problem is, the code works perfectly if both the workbooks are opened and keep opened. However, if the code opens the second workbook at the beginning of the procedure and closes it at the end before the userform is called, both the listboxes get blank. What should i do do open the second workbook at the beginning of the procedure and close it at the end without losing the data at the userform show?
Any help or other suggestions are welcome.
The code is as follows: