Hello,
I'm trying to call a procedure from another workbook without hard-coding the name of the workbook into my VBA. Rather, as I will be repeating this process, the secondary workbook names are contained within a worksheet and assigned to variables 'MyWbName' and 'TBWB'.
There's a module in each secondary workbook called 'modimport' with a procedure called 'import', but does anyone know how I can call it up?
Thanks in advance!
I'm trying to call a procedure from another workbook without hard-coding the name of the workbook into my VBA. Rather, as I will be repeating this process, the secondary workbook names are contained within a worksheet and assigned to variables 'MyWbName' and 'TBWB'.
Code:
Dim MyWBName as String
Dim TBWB as Workbook
MyWBName="workbookname.xlsm"
Workbooks(MyWBName).activate
Set TBWB = ActiveWorkbook
Call TBWB.modimport.import
There's a module in each secondary workbook called 'modimport' with a procedure called 'import', but does anyone know how I can call it up?
Thanks in advance!