Hi
I have a piece of VBA code residing in workbook A which scans the contents of a different directory looking
for .xlsm workbooks to process and updates the contents of an existing workbook B.
All the .xlsm workbooks to be processed are of the same format and structure with multiple tabs. Each tab
contains user defined macros which are stored in the Module of each .xlsm workbook.
The VBA code uses workbooks.open() to open each .xlsm workbook for processing. Running the workbook A VBA code in debugging mode, I noticed that for each .xlsm workbook that is opened for processing, the user defined macros in each of the tabs are shown as #NAME?.
This causes the processing VBA code to fail when processing each .xlsm workbook.
Opening those .xlsm workbooks from windows explorer and clicking on 'Enable Macro" do not produce the #NAME? error.
I inserted a workbook Activate statement in workbook A VBA code immediately after the workbooks.open() statement but to no avail. From the user help guide, it says that workbooks open by workbooks.open() will have macros enabled by default but it does not appear to be so in my case.
Appreciate any help or tips from all. Thanks.
Regards
Phil
Bookmarks