Excel crashes

D

Dudely

I'm using Excel 2000 under Windows XP Pro. I recently wrote some VBA
code, and had it mostly working when Excel started to first hang - and
then crash. Now it crashes everytime I bring up this particular
workbook.

I get as far as Enable or Disable macros. Upon choosing one or the
other (it doesn't matter which I choose) Excel immediately crashes.

I run AVG and Superantispyware (free versions) around the clock. I
ran superantispyware scan, spyware blaster, ad aware and anti-
malware. While they each found a couple of things, I cleaned them out
and Excel is still crashing.

Excel ONLY crashes when I bring up this one specific workbook. Being
as how I worked on the VBA code all week and it's something I really
need, I'd prefer not to have to re-write it all.

It's only 98 KB. I have no add-ins. I deleted the one .xlb file I
found, it was 8 KB.

Any ideas?

Thank you in advance
 
J

JLGWhiz

You have written some code that VBA does not like. It is confusing the
compiler with something that is not handled in trappable error category, so
it shuts down.
You can attempt to walk through the code one line at a time to see if you
can detect the problem code and fix it by opening the VB editor and using F8
to step through the code.
 
D

Dudely

Thanks, but as I stated in the original post:

" Now it crashes everytime I bring up this particular workbook. I
get as far as Enable or Disable macros. Upon choosing one or the
other (it doesn't matter which I choose) Excel immediately crashes."

Therefore, since Excel crashes immediately upon opening the workbook,
I'm unable to use the VB editor and step through the code. Further,
since it crashes even if I choose Disable Macros, it's clearly not
running my code.

Anyone else have any good ideas?

Thank you
 
G

Gary Keramidas

open it in safe mode.

1. hold the shift key down as you click the excel icon or file.
2. if it's excel 2003 and you accepted the installation path default, paste
this in the run box or create a new shortcut.
"C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE" /s

--


Gary


Thanks, but as I stated in the original post:

" Now it crashes everytime I bring up this particular workbook. I
get as far as Enable or Disable macros. Upon choosing one or the
other (it doesn't matter which I choose) Excel immediately crashes."

Therefore, since Excel crashes immediately upon opening the workbook,
I'm unable to use the VB editor and step through the code. Further,
since it crashes even if I choose Disable Macros, it's clearly not
running my code.

Anyone else have any good ideas?

Thank you
 
C

Corey

With Excel opened, but not the problem Wkbook, change Macro Security to
HIGH.
Then open the problem Wkbook to edit it.


Corey....

Thanks, but as I stated in the original post:

" Now it crashes everytime I bring up this particular workbook. I
get as far as Enable or Disable macros. Upon choosing one or the
other (it doesn't matter which I choose) Excel immediately crashes."

Therefore, since Excel crashes immediately upon opening the workbook,
I'm unable to use the VB editor and step through the code. Further,
since it crashes even if I choose Disable Macros, it's clearly not
running my code.

Anyone else have any good ideas?

Thank you
 
J

JLGWhiz

Set your security to high and save it. It should prevent any code from
running. When you open that particular workbook, you can disable any
workbook event code in the ThisWorkbook code module and reset your security
level. Then you should be able to trouble shoot and debug the remaining
code. From what you describe, it sounds like the problem could be workbook
event code.
 
V

vandenberg p

Hello:

Are you sure you got all of the xlb's, although if it affects only one workbook it is probably not the issue?
A corrupt workbook might be. Sometimes another program is less finicky and will read a corrupted file. Try
opening it in OpenOffice. (If you don't have it, it is free from openoffice.org.) If it opens you can get to
your macro sheet and copy it. Open a new file in Excel and paste the code. Or you can try a save as in
OpenOffice. (I would copy paste also just in case.)


Pieter Vandenberg
(e-mail address removed)
-----------------------------------------------
Anti-spam
Please do not reply to this message's address.
If you wish to contact me use the above address.
Thank you.
------------------------------------------------


: Thanks, but as I stated in the original post:

: " Now it crashes everytime I bring up this particular workbook. I
: get as far as Enable or Disable macros. Upon choosing one or the
: other (it doesn't matter which I choose) Excel immediately crashes."

: Therefore, since Excel crashes immediately upon opening the workbook,
: I'm unable to use the VB editor and step through the code. Further,
: since it crashes even if I choose Disable Macros, it's clearly not
: running my code.

: Anyone else have any good ideas?

: Thank you


: > You have written some code that VBA does not like. ?It is confusing the
: > compiler with something that is not handled in trappable error category, so
: > it shuts down.
: > You can attempt to walk through the code one line at a time to see if you
: > can detect the problem code and fix it by opening the VB editor and using F8
: > to step through the code.
: >
: >
: >
: > "Dudely" wrote:
: > > I'm using Excel 2000 under Windows XP Pro. ?I recently wrote some VBA
: > > code, and had it mostly working when Excel started to first hang - and
: > > then crash. ?Now it crashes everytime I bring up this particular
: > > workbook.
: >
: > > I get as far as Enable or Disable macros. ?Upon choosing one or the
: > > other (it doesn't matter which I choose) Excel immediately crashes.
: >
: > > I run AVG and Superantispyware (free versions) around the clock. ?I
: > > ran superantispyware scan, spyware blaster, ad aware and anti-
: > > malware. ?While they each found a couple of things, I cleaned them out
: > > and Excel is still crashing.
: >
: > > Excel ONLY crashes when I bring up this one specific workbook. ?Being
: > > as how I worked on the VBA code all week and it's something ?I really
: > > need, I'd prefer not to have to re-write it all.
: >
: > > It's only 98 KB. ?I have no add-ins. ?I deleted the one .xlb file I
: > > found, it was 8 KB.
: >
: > > Any ideas?
: >
: > > Thank you in advance- Hide quoted text -
: >
: > - Show quoted text -
 
D

Dudely

I"ll try some of the above ideas, I'm over at neighbors at the moment,
who is running Vista and Excel 2007

I'm able to open the workbook without it crashing. (Funny you should
mention openoffice, I started that downloading before I left to come
to the neighbor's)

So, I found one interesting error, I had a sub as follows:

sub X (parm1, parm2) instead of what should of been sub X(parm1 as
string, parm2 as object) haven't had a chance to go back and see if
this fixes the crash problem yet.

However in the meantime, I still have a problem. Here's the code:


Option Explicit

Sub iqs()
openBrowser ("http://www.iqsdirectory.com/site-map.html")
End Sub
Sub openBrowser(URLaddress As String)

Dim obIe As Object
Dim IeDoc As Object


On Error GoTo handler

Set obIe = CreateObject("InternetExplorer.Application")
obIe.navigate (URLaddress)
obIe.Visible = True

'-- LOOP UNTIL THE WINDOW HAS OPENED

'======================== executing this line causes an error usually
-2147417848 ( Automation error
The object invoked has disconnected from its clients.)
=====================


Do While obIe.Busy
'========================
DoEvents
Loop

'-- LOOP UNTIL THE PAGE HAS LOADED
Do While obIe.readyState <> 4 'READYSTATE_COMPLETE
DoEvents
Loop


'store the Document object
Set IeDoc = obIe.document


If False Then
handler:
If Err.Number = 462 Or Err.Number = -2147417848 Then
Debug.Print Err.Number, Err.Description
GoTo cleanup
End If
Resume
End If

On Error Resume Next
obIe.Application.Quit

cleanup:
Set obIe = Nothing
Set IeDoc = Nothing


End Sub


This error occurs under Vista and Excel 2007, I haven't tested it yet
under my normal XP and Excel 2000 yet.

Thank you!!!
 
D

Dudely

As mentioned in the original post, I'm running Excel 2000.

I forgot to mention in the original post that I did try safe mode and
it still crashed. However, I ran it from Start--> Run --> excel /s
and then opened my workbook from the File-->Open menu in Excel

But the bottom line is it crashed anyway.
 
C

Carl Hartness

Just reading your code, shouldn't
'======================== executing this line causes an error usually
-2147417848 ( Automation error
The object invoked has disconnected from its clients.)
=====================

all be commented out? Or is it a line wrap problem, and it really is
all one line?

Carl.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top