I'm trying to develop an excel file that contains VBA to manipulate and adjust repots that are excel files generated from SQL Server using Excel-Macro Enabled Template. The excel that contains the VBA has a List Box to shows all excel files that are open and a text box for the selected report, as shown in the attached picture.
The 1st problem I faced was to display excel report that are open in a different instance of Excel. I posted a question and I got an answer, attached link, my previous question, that solved the problem and open excel files can be shown in the List Box. The problem now is, how can I pass the name of the selected report (workbook name) to subs and functions to become the file that will be manipulated using the VBA code? I tried this way Sel_Rpt = Sheet1.TextBox1.Value and then Set Rpt = Workbooks(Sel_Rpt).Worksheets("Report"), but it didn't work.