Results 1 to 7 of 7
  1. #1
    5 Star Lounger
    Join Date
    May 2001
    Location
    Philadelphia, Pennsylvania
    Posts
    676
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Moving modules vs moving sheet tabs (Excel 2000)

    We have a template for users in the field. It interfaces with Oracle. When the users try to move the sheets into a new workbook, the template fails, I am told, because the macro modules do not move with the sheet. Is this generally true, or is it something with that template? How could they move both the module and the code so that the template will work? In many instances, the workbook is large and it seems simpler to move the 3-sheet template to the workbook rather than the large workbook to the template.

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Moving modules vs moving sheet tabs (Excel 2000)

    If you move (or copy) a sheet sheet in a workbook, the ONLY code that comes along is the macro code that is IN the sheet object. NONE of the modules are transferred.

    You could use SAVE AS and then delete any unwanted sheets and the macros would then be in the new file.

    Steve

  3. #3
    5 Star Lounger
    Join Date
    May 2001
    Location
    Philadelphia, Pennsylvania
    Posts
    676
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Moving modules vs moving sheet tabs (Excel 2000)

    I have seen the Import File and Export file menu items, and have exported modules before. Could they export the module into the large workbook and then move the sheet? Would that be viable?

  4. #4
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Moving modules vs moving sheet tabs (Excel 200

    It's feasible to move the modules to follow the sheets using export and import - albeit a bit labour-intensive. I'm not at all sure that it can be automated.
    Gre

  5. #5
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Moving modules vs moving sheet tabs (Excel 2000)

    Check out the code on Chip Pearson's site
    It has code on exporting and copying modules.

    Steve

  6. #6
    5 Star Lounger
    Join Date
    May 2001
    Location
    Philadelphia, Pennsylvania
    Posts
    676
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Moving modules vs moving sheet tabs (Excel 200

    So if I exported the code module for the Oracle-related stuff to a text file on the desktop, then moved the tabs (there are 3 tabs in the standard template) into the larger workbook, I could import the text file macro to the larger workbook and (hopefully) the template would then work. I shall try that. The Pearson site may be a little over my head at present (I will give it a try) but I need to be careful that I understand what's goin on and don't do a Sorcerer's Apprentice Event. Thanks to all for the good suggestions.

  7. #7
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Moving modules vs moving sheet tabs (Excel 200

    It is not strictly necessary to go the extra step of saving your Module as a TXT file. You could simply work with the default BAS extension.

    I could be wrong, but I would think that the TXT format has the advantage of defaulting to opening inside a Text Editor - if you want to work with the code outside the VB Editor.
    Gre

Posting Permissions

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