LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Excel 2003 - VBA to get a list of Module names in the project

We have Excel VBA templates that produce reports for customers when our code opens these reports. They have to enable macros and on completion, they save the results to their laptops. The issue is that they open these later and are still in the habit of enabling macros for the saved report. As the data has been fully formatted already, the macros fail the second time around (as we would expect).

Given this issue, I am looking at adding code to delete macro modules at the end of the initial report formatting and am ok with this up to a point.

I would, however, like the code to retrieve the list of modules and only delete those that will ensure that no code is attempted that ill fail.

For example:

AutoOpen module - standard for all our templates and just has 2 commands, 1 to run a procedure called Main_Process in a module called MainProcess and one to run th Kill_VBCode procedure in the modVBKillCode module. I will simply have code to comment out the Main_Process and Kill_VBCode calls and am ok with this

MainProcess module - want to delete this in the Kill_VBCode

AnotherModule module (could be any name) - want to delete this in the Kill_VBCode

modVBKillCode - leave alone

Thus, in short, I need a piece of code within modVBKillCode that gets a list of modules, runs the "comment out" code for AutoOpen, leaves modVBKillCode alone and deletes all other modules. So all I need is the loop that will give me the module names and then I can call the delete/comment code accordingly. It is just getting this list that is the issue. Code for deleting and commenting out is elsewhere on the web.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel module: Mark records if it contains names out of another list johan Excel Programming 4 February 4th 12 06:01 AM
Excel 2003 list of names and calling Lion2004[_2_] Excel Programming 4 October 1st 09 11:46 AM
Project - VBA Project window - Excel 2003 Jarek Kujawa[_2_] Excel Programming 9 October 1st 09 08:00 AM
With VBA from Excel: Open Project, extract resource list and copy it to a worksheet, close project. Tony Excel Programming 1 October 18th 05 03:53 PM
Module Names within a Project WSF Excel Programming 2 May 15th 04 11:51 PM


All times are GMT +1. The time now is 06:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"