Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default How to proceed after crash with message: Microsoft Excel has stopped working

My macro enabled spreadsheet has started randomly crashing. The only diagnostics is the message Microsoft Excel has stopped working. I am running Excel 2010 under Windows 7.

I think I have isolated the problem to a vba subroutine (InitializeReport) that populates a Type data structure (Public Type TableMetadata) that is defined in the Declarations section of Module1. In the same section I set up a public variable (Public lref as TableMetadata).

My test subroutine displays MsgBox popups before and after calling InitializeReport. If the crash occurs, it is between the two popups. However, if I run in Debug mode (just a few steps) the problem never occurs and in fact may go away for a while.

Obviously, something is not being initialized correctly. The code in InitializeReport looks very innocuous.

My main frustration is that I have no tool to get further information on the problem, since everything works fine in Debug mode, and also the spreadsheet will often work for periods with no occurrence.

Would appreciate if anybody has a suggestion on a strategy to get more info on the problem. Can't understand why Excel cannot produce a dump or some information on what went wrong.

I am even prepared to purchase Excel 2014 to see if the problem will go away.

Thank you
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 538
Default How to proceed after crash with message: Microsoft Excel has stopped working

Desmond Walsh wrote:

My macro enabled spreadsheet has started randomly crashing. The only
diagnostics is the message Microsoft Excel has stopped working. I am
running Excel 2010 under Windows 7.

I think I have isolated the problem to a vba subroutine
(InitializeReport) that populates a Type data structure (Public Type
TableMetadata) that is defined in the Declarations section of Module1.
In the same section I set up a public variable (Public lref as
TableMetadata).

My test subroutine displays MsgBox popups before and after calling
InitializeReport. If the crash occurs, it is between the two popups.
However, if I run in Debug mode (just a few steps) the problem never
occurs and in fact may go away for a while.

Obviously, something is not being initialized correctly. The code in
InitializeReport looks very innocuous.

My main frustration is that I have no tool to get further information on
the problem, since everything works fine in Debug mode, and also the
spreadsheet will often work for periods with no occurrence.

Would appreciate if anybody has a suggestion on a strategy to get more
info on the problem. Can't understand why Excel cannot produce a dump or
some information on what went wrong.

I am even prepared to purchase Excel 2014 to see if the problem will go
away.


After each line of code, dump a line to your own log file indicating where
your code is. The next time you get a crash, the last line printed in the log
will suggest where your crash is happening.

--
Do you think they would approve a purchase order for a flamethrower?
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to proceed after crash with message: Microsoft Excel hasstopped working

On Saturday, December 2, 2017 at 3:46:45 PM UTC-8, Desmond Walsh wrote:
My macro enabled spreadsheet has started randomly crashing. The only diagnostics is the message Microsoft Excel has stopped working. I am running Excel 2010 under Windows 7.

I think I have isolated the problem to a vba subroutine (InitializeReport) that populates a Type data structure (Public Type TableMetadata) that is defined in the Declarations section of Module1. In the same section I set up a public variable (Public lref as TableMetadata).

My test subroutine displays MsgBox popups before and after calling InitializeReport. If the crash occurs, it is between the two popups. However, if I run in Debug mode (just a few steps) the problem never occurs and in fact may go away for a while.

Obviously, something is not being initialized correctly. The code in InitializeReport looks very innocuous.

My main frustration is that I have no tool to get further information on the problem, since everything works fine in Debug mode, and also the spreadsheet will often work for periods with no occurrence.

Would appreciate if anybody has a suggestion on a strategy to get more info on the problem. Can't understand why Excel cannot produce a dump or some information on what went wrong.

I am even prepared to purchase Excel 2014 to see if the problem will go away.

Thank you


I have similar problems. When I look in Task Manager, it shows 30% of cpu going to Excel (2016/win 10 for me). Sometimes it goes to "stopped working" Sometimes it just goes into a non-interruptable state (ctrl break and escape do nothing). Once I left it for an hour... It comes and goes. Can't tie it to data differences, or machine state. Sometimes restarting Excel makes it work. Sometimes restarting Windows does. And sometimes neither. Frustrating to sayu the least.

There is a lot of code, so inserting a log dump after each statement (as Auric suggests) is impractical. There SHOULD be (and maybe there is, but I don't know it) a way to call "Start detailed logging" and then call "Stop detailed logging." Ideas?
Thanks!
Pete A
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,182
Default How to proceed after crash with message: Microsoft Excel has stopped working

My macro enabled spreadsheet has started randomly crashing. The only
diagnostics is the message Microsoft Excel has stopped working. I am running
Excel 2010 under Windows 7.

I think I have isolated the problem to a vba subroutine (InitializeReport)
that populates a Type data structure (Public Type TableMetadata) that is
defined in the Declarations section of Module1. In the same section I set up
a public variable (Public lref as TableMetadata).

My test subroutine displays MsgBox popups before and after calling
InitializeReport. If the crash occurs, it is between the two popups. However,
if I run in Debug mode (just a few steps) the problem never occurs and in
fact may go away for a while.

Obviously, something is not being initialized correctly. The code in
InitializeReport looks very innocuous.

My main frustration is that I have no tool to get further information on the
problem, since everything works fine in Debug mode, and also the spreadsheet
will often work for periods with no occurrence.

Would appreciate if anybody has a suggestion on a strategy to get more info
on the problem. Can't understand why Excel cannot produce a dump or some
information on what went wrong.

I am even prepared to purchase Excel 2014 to see if the problem will go away.

Thank you


I agree with Auric_'s idea about error logging, but I use error logging in
procedures to indicate which routine causes the error. Then I examine the
offending routine further in blocks of suspect code. Usually the cause can be
readily spotted...

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default How to proceed after crash with message: Microsoft Excel hasstopped working

On Saturday, December 2, 2017 at 10:32:56 PM UTC-5, Auric__ wrote:
Desmond Walsh wrote:

My macro enabled spreadsheet has started randomly crashing. The only
diagnostics is the message Microsoft Excel has stopped working. I am
running Excel 2010 under Windows 7.

I think I have isolated the problem to a vba subroutine
(InitializeReport) that populates a Type data structure (Public Type
TableMetadata) that is defined in the Declarations section of Module1.
In the same section I set up a public variable (Public lref as
TableMetadata).

My test subroutine displays MsgBox popups before and after calling
InitializeReport. If the crash occurs, it is between the two popups.
However, if I run in Debug mode (just a few steps) the problem never
occurs and in fact may go away for a while.

Obviously, something is not being initialized correctly. The code in
InitializeReport looks very innocuous.

My main frustration is that I have no tool to get further information on
the problem, since everything works fine in Debug mode, and also the
spreadsheet will often work for periods with no occurrence.

Would appreciate if anybody has a suggestion on a strategy to get more
info on the problem. Can't understand why Excel cannot produce a dump or
some information on what went wrong.

I am even prepared to purchase Excel 2014 to see if the problem will go
away.


After each line of code, dump a line to your own log file indicating where
your code is. The next time you get a crash, the last line printed in the log
will suggest where your crash is happening.

--
Do you think they would approve a purchase order for a flamethrower?




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default How to proceed after crash with message: Microsoft Excel hasstopped working

On Saturday, December 2, 2017 at 10:32:56 PM UTC-5, Auric__ wrote:
Desmond Walsh wrote:

My macro enabled spreadsheet has started randomly crashing. The only
diagnostics is the message Microsoft Excel has stopped working. I am
running Excel 2010 under Windows 7.

I think I have isolated the problem to a vba subroutine
(InitializeReport) that populates a Type data structure (Public Type
TableMetadata) that is defined in the Declarations section of Module1.
In the same section I set up a public variable (Public lref as
TableMetadata).

My test subroutine displays MsgBox popups before and after calling
InitializeReport. If the crash occurs, it is between the two popups.
However, if I run in Debug mode (just a few steps) the problem never
occurs and in fact may go away for a while.

Obviously, something is not being initialized correctly. The code in
InitializeReport looks very innocuous.

My main frustration is that I have no tool to get further information on
the problem, since everything works fine in Debug mode, and also the
spreadsheet will often work for periods with no occurrence.

Would appreciate if anybody has a suggestion on a strategy to get more
info on the problem. Can't understand why Excel cannot produce a dump or
some information on what went wrong.

I am even prepared to purchase Excel 2014 to see if the problem will go
away.


After each line of code, dump a line to your own log file indicating where
your code is. The next time you get a crash, the last line printed in the log
will suggest where your crash is happening.

--
Do you think they would approve a purchase order for a flamethrower?


Thanks for excellent suggestion. I open the log file, append line just executed and then close before executing next line. It showed me the offending line is :
lref.LastIndex = tableObj.Range.Columns.Count + tableObj.DataBodyRange.Column - 1

I have a Table - (184,136) and am trying to find index of last Column (136).. The offending subroutine is called from Workbook_Open. Sometimes it works fine. If it starts crashing, I open without calling Workbook_Open (keep Shift down) and by stepping in Debugger its starts working.

Although, I still do not understand why Excel is crashing, I have far more information on what triggers the crash. Thank you
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
microsoft excel has stopped working message giving by program [email protected] Excel Discussion (Misc queries) 0 January 11th 14 06:18 AM
Microsoft office excel 2003 has stopped working Veeshal Excel Discussion (Misc queries) 3 September 24th 09 07:30 PM
Microsoft Office Excel has stopped working KC Excel Discussion (Misc queries) 0 August 29th 08 05:37 AM
microsoft office excel has stopped working ahmed taha Excel Discussion (Misc queries) 0 May 19th 08 12:32 PM
Displaying a message in a message box without requiring user to click anything to proceed Android[_2_] Excel Programming 2 June 25th 04 06:44 PM


All times are GMT +1. The time now is 06:47 PM.

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"