Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 274
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 274
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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
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
Run Macro Automatically When Excel 2003 Opens CBender Excel Discussion (Misc queries) 2 May 7th 10 05:25 PM
writing a macro that automatically opens another file J.Mart[_2_] Excel Discussion (Misc queries) 3 August 12th 08 10:44 PM
VBA Editor opens automatically after unlocking machine JB2010 Excel Discussion (Misc queries) 1 March 12th 07 05:20 PM
Macro now opens up VBA editor - not intended excelnut1954 Excel Programming 4 February 13th 06 05:39 PM
VBA Editor opens by itself? Ed[_18_] Excel Programming 0 May 11th 04 05:29 PM


All times are GMT +1. The time now is 02:00 AM.

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

About Us

"It's about Microsoft Excel"