View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
rick rick is offline
external usenet poster
 
Posts: 25
Default Code compiles but Excel ERROR

Hi,

I don't know if this applies to you, but one time I had
Excel lock up on me because I had two subroutines with
exactly the same name. Excel did not like that at all! I
think it just shut down...or I had a dreaded message you
got, and then it shut down automatically. The only way I
could get in the Excel Workbook, was to push the disable-
macro button, and then find the duplication.

I don't know if you would have to disable the macros too.
It doesn't sound necessary, but I thought I would mention
it anyway. It was so obvious, but it took me sometime to
break old habits of always hitting the enable-macro
button, before I realized an easy way of getting in, when
there was a VBA programming conflict such as that.

Maybe to find your coding problem, you could comment out
sections of code, line by line...possibly at first
eliminating some of the modules. Keep doing it, until it
goes away. I know that might be boring and laborious, but
I think you'll at least isolate the section that is giving
you the problems.

I'm not sure if this would work in your case, but here's
some code to identify errors. This is some sample
language to add to each of your subroutines.

Sub YourSubroutines()
~~~Dim Variables Here~~~
On Error GoTo Line1:
~~~Code Here ~~~
Exit sub
Line1:
MsgBox Err.Number & " " & Err.Description
End Sub

I hope that helps some.

Rick


-----Original Message-----
Hi,

I have basically finished coding a workbook for my work

to create
Testnumbers
for inter-office faxing authentication. Everything works

fine, all the
code compiles and all the buttons and userforms display

and show/do as
expected.

I can also save the book, BUT about 2 days ago , when I

CLOSE/Exit the
wb Windows gives the Dreaded "This program have

performed an Illegal
operation"
moan message & closes and locks Excel!

Is my code badly written? to many loops?
I tried to do things differently, here and there, but to

no avail.

Is there any basic things to checkup on, for this error.

Isn't Excel
suppose to
pickup any errors in your code, and avoid this?

Any help will be GREATLY appreciated...
.