View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default How to get rid of a VBAProject?

Maybe this is your problem

If you Dim outside your macro like this at the
top of your module

Dim WB As Workbook

Sub test()
Set WB = Workbooks.Open("c:\data\ron.xls")
'your code
WB.Close False
End Sub

You still can see the VBAProject in the VBE

Use this then

Sub test()
Set WB = Workbooks.Open("c:\data\ron.xls")
'your code
WB.Close False
Set WB = Nothing
End Sub

Or Dim in the macro



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"GF" wrote in message ...
Excell2002
WB(a) opens WB(1),WB(2),...,WB(n) successively, makes sg
with them then colses them peacefully.
Each of the WB(i) contains VBAProject too.
After closing WB(i), its VBAProject remains still
existing, that causes the application stall.
How coud I get rid of the VBAProject belonging to a closed
WB?
SOS!