Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
wkbModel.wb_Activate
there is a macro that sends an email which has been working for ages. Now
suddenly it fails on the row below, message stating that it cannot find the macro. Application.Run "wkbModel.wb_Activate" i cannot find a macro with this name in the workbook and the .wb completely throws me. I will be grateful for any ideas as to what this might be. many thanks -- with kind regards Spike |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
wkbModel.wb_Activate
When you create a new module in the VBE, excel names it Module1, Module2, ...
But you can rename it to any (legal) name you want. In this case, it looks like someone renamed one of the modules to wkbModel. So look for that module in the project explorer (hit ctrl-r to see if it's not visible). If you don't have a module by that name in that workbook, then this is a problem. Maybe it was deleted or renamed. Next, look for that procedure (wb_activate). It's just a name and nothing to do with any of the events that excel monitors. If you find it in a different module, you can change the line from: Application.Run "wkbModel.wb_Activate" to Application.Run "NewModuleName.wb_Activate" or simply: call NewModuleName.wb_Activate And if there's only one procedure with the wb_activate name, you don't even need the module name: Call wb_Activate Is sufficient. If you can't find a procedure with this name (wb_activate), then you may be able to copy it from a old version (or from a backup file????). Spike wrote: there is a macro that sends an email which has been working for ages. Now suddenly it fails on the row below, message stating that it cannot find the macro. Application.Run "wkbModel.wb_Activate" i cannot find a macro with this name in the workbook and the .wb completely throws me. I will be grateful for any ideas as to what this might be. many thanks -- with kind regards Spike -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
wkbModel.wb_Activate
Thank you for that, looks like someone has deleted it. The ".wb" threw me.
-- with kind regards Spike "Dave Peterson" wrote: When you create a new module in the VBE, excel names it Module1, Module2, ... But you can rename it to any (legal) name you want. In this case, it looks like someone renamed one of the modules to wkbModel. So look for that module in the project explorer (hit ctrl-r to see if it's not visible). If you don't have a module by that name in that workbook, then this is a problem. Maybe it was deleted or renamed. Next, look for that procedure (wb_activate). It's just a name and nothing to do with any of the events that excel monitors. If you find it in a different module, you can change the line from: Application.Run "wkbModel.wb_Activate" to Application.Run "NewModuleName.wb_Activate" or simply: call NewModuleName.wb_Activate And if there's only one procedure with the wb_activate name, you don't even need the module name: Call wb_Activate Is sufficient. If you can't find a procedure with this name (wb_activate), then you may be able to copy it from a old version (or from a backup file????). Spike wrote: there is a macro that sends an email which has been working for ages. Now suddenly it fails on the row below, message stating that it cannot find the macro. Application.Run "wkbModel.wb_Activate" i cannot find a macro with this name in the workbook and the .wb completely throws me. I will be grateful for any ideas as to what this might be. many thanks -- with kind regards Spike -- Dave Peterson . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|