Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
microsoft excel has stopped working message giving by program | Excel Discussion (Misc queries) | |||
Microsoft office excel 2003 has stopped working | Excel Discussion (Misc queries) | |||
Microsoft Office Excel has stopped working | Excel Discussion (Misc queries) | |||
microsoft office excel has stopped working | Excel Discussion (Misc queries) | |||
Displaying a message in a message box without requiring user to click anything to proceed | Excel Programming |