Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default Macro now opens up VBA editor - not intended

This is very strange. I ran a macro in a worksheet that does quite of
few routines, and has worked good up until now. Today, I ran it, and at
the end of it all, it now opens up the VBA Editor, and shows all the
UserForms, and Modules.

I have never had it do this. I don't even know how to write the code
for that.

I noticed all this when I ran the macro today, and at the very end of
all the routines, it asked for the PW to open up the editor. (I've had
a PW on it since I started building macros in it.)
I removed the PW, opened the workbook up again, and ran the macro. It
still went to the editor, and opened up all the forms, modules, etc.

Any ideas why this is happening?
Thanks,
J.O.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default Macro now opens up VBA editor - not intended

My guess is that you are hitting an error and the program is breaking on the
error. Does an error message pop up or not. Check your VBA editor Under tools
- Options - General it should be set to Break on Unhandled Errors. The
other thing to do is to open the Project and make sure the code compiles
Debug - Compile
--
HTH...

Jim Thomlinson


"excelnut1954" wrote:

This is very strange. I ran a macro in a worksheet that does quite of
few routines, and has worked good up until now. Today, I ran it, and at
the end of it all, it now opens up the VBA Editor, and shows all the
UserForms, and Modules.

I have never had it do this. I don't even know how to write the code
for that.

I noticed all this when I ran the macro today, and at the very end of
all the routines, it asked for the PW to open up the editor. (I've had
a PW on it since I started building macros in it.)
I removed the PW, opened the workbook up again, and ran the macro. It
still went to the editor, and opened up all the forms, modules, etc.

Any ideas why this is happening?
Thanks,
J.O.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default Macro now opens up VBA editor - not intended

Well, I checked, and the settings in Tools are ok.
I run the Compile Worksheet, and it gives errors in modules that I'm
working on. There are lots of code in here that doesn't work right.
But, I'm not using these subs. There just there to work on (saving the
file to another name when testing).

So, the Compile thing doesn't do much good for me.
Also, there is no error message. All the routines seem to work ok.
Everything does what its suppose to.

I'll have to go back and find the last file that worked ok. These are
renamed each day.

If you have other ideas, I would appreciate it.
Thanks,
J.O.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Macro now opens up VBA editor - not intended

"Jim Thomlinson"
wrote

- Options - General it should be set to Break on Unhandled
Errors.


Actually, it is better to set the Error Trapping option to 'Break
in Class Module', so that if there is an error in a class module
(or ThisWorkbook or a sheet module or form), you'll break in the
class module itself, rather than the call to the class module's
methods.

To illustrate, just put

Public Sub X()
Debug.Print 1 / 0
End Sub

in ThisWorkbook. Then, from a general module, run

Sub AAA()
ThisWorkbook.X
End Sub

Change the Error Trapping options between 'Break On Handled
Errors' and 'Break In Class Module' to see where the code breaks.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com





"Jim Thomlinson"
wrote in message
...
My guess is that you are hitting an error and the program is
breaking on the
error. Does an error message pop up or not. Check your VBA
editor Under tools
- Options - General it should be set to Break on Unhandled
Errors. The
other thing to do is to open the Project and make sure the code
compiles
Debug - Compile
--
HTH...

Jim Thomlinson


"excelnut1954" wrote:

This is very strange. I ran a macro in a worksheet that does
quite of
few routines, and has worked good up until now. Today, I ran
it, and at
the end of it all, it now opens up the VBA Editor, and shows
all the
UserForms, and Modules.

I have never had it do this. I don't even know how to write
the code
for that.

I noticed all this when I ran the macro today, and at the very
end of
all the routines, it asked for the PW to open up the editor.
(I've had
a PW on it since I started building macros in it.)
I removed the PW, opened the workbook up again, and ran the
macro. It
still went to the editor, and opened up all the forms,
modules, etc.

Any ideas why this is happening?
Thanks,
J.O.




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
Visual Basic Editor opens bi itself KG Excel Discussion (Misc queries) 0 September 15th 07 04:02 PM
VB editor opens by magic dallag Excel Programming 4 January 10th 06 01:23 PM
Computer Lock opens up VB editor Phaedrus Excel Programming 2 December 6th 05 12:45 AM
macro not working as intended Michael A Excel Programming 4 March 7th 05 01:29 AM
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 10:17 PM.

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"