Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBE Editor opens automatically when I run a macro
Hi!
I'm using a command button in an excel worksheet to show a userform. I have assigned a macro to the command button. All the macro does is open a userform named "frmKitForms." The macro is in a standard module. Here it is: Sub KitForms() frmKitForms.Show End Sub When I click the command button that runs the macro the VBE Editor opens and the line of code (i.e. frmKitForms.Show) is highlighted in yellow. If I click F5, the code opens my userform like normal. If I step through the code using F8, the code does not proceed to End Sub, it just goes back to Sub KitForms(), and returns an error when it reads the frmKitForms.Show line. Does anyone know why the VBE editor is opening automatically at all? Regards, Tim |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBE Editor opens automatically when I run a macro
Tim, Unhelpfully if there is a coding error contained in a form the debugger will the highlight frm.show code line. I usually find that its the 'initialize' event that causes this but that wont neceesarily be the case. Suggest you can try 'commenting out' sections of code to isolate what causing the problem or if possible paste the code into a normal module and run from there. Regards Mike beckinsale |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBE Editor opens automatically when I run a macro
You can force it to break on the actual error.
In the VBIDE, goto ToolsOptions, select the General tab from the dialog, and set the 'Break in Class Module' button in the 'Error Trapping' frame. -- HTH Bob Phillips (replace xxxx in the email address with gmail if mailing direct) "michael.beckinsale" wrote in message ups.com... Tim, Unhelpfully if there is a coding error contained in a form the debugger will the highlight frm.show code line. I usually find that its the 'initialize' event that causes this but that wont neceesarily be the case. Suggest you can try 'commenting out' sections of code to isolate what causing the problem or if possible paste the code into a normal module and run from there. Regards Mike beckinsale |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBE Editor opens automatically when I run a macro
Bob, Thanks. You learn something every day! Is there any down side to this action? Regards Michael Beckinsale |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBE Editor opens automatically when I run a macro
Thank you both for your speedy replies!
Bob: I did as you said, selected "Break Class Module", and there is no change--it still breaks on the same line of code (i.e. on frmKitForms.Show). The strange thing is I can open the VBIDE, go to the procedure and push F5 (or step through with F8) and everything works fine. The problem occurs specifically when I run the macro from the cmd btn on my worksheet. Any more thoughts are greatly appreciated! Regards, Tim Bob Phillips wrote: You can force it to break on the actual error. In the VBIDE, goto ToolsOptions, select the General tab from the dialog, and set the 'Break in Class Module' button in the 'Error Trapping' frame. -- HTH Bob Phillips (replace xxxx in the email address with gmail if mailing direct) "michael.beckinsale" wrote in message ups.com... Tim, Unhelpfully if there is a coding error contained in a form the debugger will the highlight frm.show code line. I usually find that its the 'initialize' event that causes this but that wont neceesarily be the case. Suggest you can try 'commenting out' sections of code to isolate what causing the problem or if possible paste the code into a normal module and run from there. Regards Mike beckinsale |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Run Macro Automatically When Excel 2003 Opens | Excel Discussion (Misc queries) | |||
writing a macro that automatically opens another file | Excel Discussion (Misc queries) | |||
VBA Editor opens automatically after unlocking machine | Excel Discussion (Misc queries) | |||
Macro now opens up VBA editor - not intended | Excel Programming | |||
VBA Editor opens by itself? | Excel Programming |