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.
[VBA]
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
[/VBA]
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:
[VBA] Workbooks("BNV.xls").Close savechanges:=TRUE [/VBA]
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.?
Bookmarks