![]() |
VBA for Excel 2000 file is corrupt
Hello, I have a strange thing. There are different functions which are creating some excel sheets, in these excel sheets is temporarily data created and after the create the sheets are deleted. With Workbooks(Substn_WB) .Worksheets("temp_KV").Delete .Worksheets("temp_CBTYP").Delete .Worksheets("temp_XFMR").Delete .Worksheets("temp_LINE").Delete .Worksheets("temp_DCLN").Delete End With The temporarily data is used for three existing sheets which where before the create and after the create still there. If the excel file is closed by: Workbooks("BNV.xls").Close savechanges:=TRUE I open the file with excel, I get the following message (see my attachement). I click oke and Excel is crashing, all the excel windows are being closed. If I try to open it again I get the message that the file is locked. I see in the task manager that the Excel proces is still running. I stop the excel process with the task manager. If I now try to open the BNV file again, Excel is crashing and so on..... If I Leave the file open which means the file is not closed by VBA, I stop my VBA applicatieon (a userform with functions) and I close the BNV.xls file manually then, I can open the file without any problem????? Does somebody have a idea what the problem can be? Should it have something todo with objects which are left behind in memory or... How can I delete in another way the excel sheets? Are there testtools that I can see that memory is still allocated etc.? +-------------------------------------------------------------------+ |Filename: vba error.gif | |Download: http://www.excelforum.com/attachment.php?postid=3427 | +-------------------------------------------------------------------+ -- nkamp ------------------------------------------------------------------------ nkamp's Profile: http://www.excelforum.com/member.php...o&userid=23760 View this thread: http://www.excelforum.com/showthread...hreadid=374138 |
All times are GMT +1. The time now is 11:29 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com