+ Reply to Thread
Results 1 to 2 of 2

import cls file on multiple workbooks

  1. #1
    Registered User
    Join Date
    06-10-2013
    Location
    boston
    MS-Off Ver
    Excel 2010
    Posts
    79

    import cls file on multiple workbooks

    I am trying to figure out if there is a way to import a .cls file into multiple workbooks in a folder. I have 50 workbooks, .xlsm files, and they all use the same modules and sheet codes. I have discovered an error in one of the sheet codes that i have corrected. I exported the code, sheet4.cls, and now I need to import the cls file into each workbook and overwrite the original code on sheet4. Is there a quick way to do that?? I am trying to avoid the copy paste method 50 times. Any ideas would be great.

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: import cls file on multiple workbooks

    Hi onbeillp111,

    The following 'Ordinary Code Module' code also in the attached file needs the following prerequisites:
    Prerequisites (one time only activation required):
    1. Enable programmatic access to the VBA Project (runtime Error 1004 [Programmatic access to Visiual Basic is NOT TRUSTED] if not done).
    In Excel 2003 and earlier, go the Tools menu (in Excel, not in the VBA editor),
    choose Macros and then the Security item. In that dialog,
    click on the Trusted Publishers tab and check the Trust access to the Visual Basic Project setting.

    In Excel 2007+, click the 'Developer' item on the main Ribbon and then click the 'Macro Security' item
    in the Code panel. In that dialog, choose Macro Settings and check the Trust access to
    the VBA project object model.

    2. Enable Microsoft Visual Basic For Applications Extensibility 5.3.
    Generates Compile error: [User-defined type not defined] if not done.
    In the VBA editor, go the the 'Tools' menu and choose 'References'.
    In that dialog, scroll down to and check the entry for
    Microsoft Visual Basic For Applications Extensibility 5.3
    or
    'Left Click' the 'Enable 'Microsoft Visual Basic For Applications Extensibility 5.3' Library Reference CommandButton.

    In an ordinary Code Module:
    Please Login or Register  to view this content.
    Lewis

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Code to copy range from 200 + workbooks and paste into one csv import file
    By CharlieMappley in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-14-2013, 10:41 AM
  2. Import Named Range from multiple Excel Workbooks
    By berger01 in forum Access Programming / VBA / Macros
    Replies: 2
    Last Post: 05-13-2013, 05:33 PM
  3. [SOLVED] Import data from multiple workbooks into master workbook
    By Jeepster325 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-07-2013, 06:44 PM
  4. [SOLVED] Import Multiple Workbooks into One WorkSheet based on Accounts
    By Kinez101 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-26-2012, 03:51 PM
  5. Import a specific sheet from multiple workbooks
    By thedon_1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-19-2011, 11:22 AM
  6. Import multiple csv workbooks into master workbook
    By wruwtrix in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-14-2009, 12:02 AM
  7. Using Query to Import Data from Multiple Workbooks
    By laundry125 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-19-2008, 03:24 AM
  8. [SOLVED] import multiple workbooks into 1 workbook
    By Anita in forum Excel General
    Replies: 10
    Last Post: 03-07-2005, 10:52 PM

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