Results 1 to 5 of 5

[SOLVED]:Opening workbooks and enabling user defined macros to run in those workbooks

Threaded View

vbarookie [SOLVED]:Opening workbooks... 01-03-2012, 04:34 PM
OnErrorGoto0 Re: Opening workbooks and... 01-03-2012, 04:41 PM
vbarookie Re: Opening workbooks and... 01-04-2012, 12:01 PM
vbarookie Re: Opening workbooks and... 01-04-2012, 11:35 PM
vbarookie Re: [SOLVED]:Opening... 01-05-2012, 12:00 AM
  1. #1
    Registered User
    Join Date
    02-21-2006
    Posts
    27

    [SOLVED]:Opening workbooks and enabling user defined macros to run in those workbooks

    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
    Last edited by vbarookie; 01-04-2012 at 11:38 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1