ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using code to replace code modules (https://www.excelbanter.com/excel-programming/408825-using-code-replace-code-modules.html)

PO

Using code to replace code modules
 
Excel 2003, SP2

Hi,

I have distributed a custom template among the coworkers in my company. The
template creates a custom menu. There is however a bug in the menu creation
code and I need to replace it. I have sent out new templates but I still
need to fix the workbooks created by it.

The plan is to have them email me the workbooks and replace the faulty
module "Menus" with a new one (also called "Menus"). I will get help
replacing the modules but the person who will help isn't familiar with the
VBE and I don't want him to have replace the module manually.

Therefore, is there a way to use code (in a separate workbook) to:

1. Unprotect the project (password is RevCalc)
2. Remove the faulty module (Menus)
3. Import the new module (at c:\data\Menus.bas)

Regards
PO



FSt1

Using code to replace code modules
 
hi
see this site. lot of good stuff up your current alley.
http://cpearson.com/excel/vbe.aspx

regards
FSt1

"PO" wrote:

Excel 2003, SP2

Hi,

I have distributed a custom template among the coworkers in my company. The
template creates a custom menu. There is however a bug in the menu creation
code and I need to replace it. I have sent out new templates but I still
need to fix the workbooks created by it.

The plan is to have them email me the workbooks and replace the faulty
module "Menus" with a new one (also called "Menus"). I will get help
replacing the modules but the person who will help isn't familiar with the
VBE and I don't want him to have replace the module manually.

Therefore, is there a way to use code (in a separate workbook) to:

1. Unprotect the project (password is RevCalc)
2. Remove the faulty module (Menus)
3. Import the new module (at c:\data\Menus.bas)

Regards
PO





All times are GMT +1. The time now is 05:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com