Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel crashes when copying worksheets
Dear all,
I have created a workbook and an excel add in file. With the workbook open I use a procedure from the add-in which creates copies of a worksheet. It works with something like: Worksheets("Template").Copy Befo=Sheets("WorkArea") Worksheets("Template (2)").Visible = True Worksheets("Template (2)").Activate ActiveSheet.Name = "T" & HNumber Then a routine is called which fills the new worksheet with data coming from text files. Call LoadData(FileName, ErrorCode) This is then repeated in a loop. This procedure works only 80 % of the time well. Every now and then Excel (97 version) crashes and reports: the instruction at "0x...." referenced memory at "0x...". The memory can not be "read". This happens very irregularly and it happens either in the procedure part where the worksheet is copied as well as in the procedure which loads the data . If I try to run the whole procedure using the debugger the crash may not happen at all or at a completely different point then before. I have tried many things to improve the stability but none with real success. Can someone give any guidelines how to improve the calculation stability ? Probably I have to mention that the worksheets make a number of calls to functions contained in the add-in. I have already tried to make these functions as save as possible. Thanks, any suggestions are appreciated Martien |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel crashes when copying worksheets
Martien,
Maybe one of these will have something that helps... http://support.microsoft.com/?kbid=210684 Xl2000: Copying Worksheet Programmatically Causes Run-Time Error 1004 http://support.microsoft.com/?kbid=177634 Xl97: Copy Method Of Sheets Object Causes Invalid Page Fault Regards, Jim Cone San Francisco, CA "Martien Janssen" wrote in message ... Dear all, I have created a workbook and an excel add in file. With the workbook open I use a procedure from the add-in which creates copies of a worksheet. It works with something like: Worksheets("Template").Copy Befo=Sheets("WorkArea") Worksheets("Template (2)").Visible = True Worksheets("Template (2)").Activate ActiveSheet.Name = "T" & HNumber Then a routine is called which fills the new worksheet with data coming from text files. Call LoadData(FileName, ErrorCode) This is then repeated in a loop. This procedure works only 80 % of the time well. Every now and then Excel (97 version) crashes and reports: the instruction at "0x...." referenced memory at "0x...". The memory can not be "read". This happens very irregularly and it happens either in the procedure part where the worksheet is copied as well as in the procedure which loads the data . If I try to run the whole procedure using the debugger the crash may not happen at all or at a completely different point then before. I have tried many things to improve the stability but none with real success. Can someone give any guidelines how to improve the calculation stability ? Probably I have to mention that the worksheets make a number of calls to functions contained in the add-in. I have already tried to make these functions as save as possible. Thanks, any suggestions are appreciated Martien |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007 crashes on copying worksheet to new workbook | Excel Discussion (Misc queries) | |||
Excel crashes when copying to Word?? | Excel Discussion (Misc queries) | |||
Password protected workbook crashes copying worksheet | Excel Discussion (Misc queries) | |||
What exactly excel do when copying worksheets? | Excel Discussion (Misc queries) | |||
Copying worksheets into different Excel files | Excel Discussion (Misc queries) |