How to get rid of a VBAProject?

  • Thread starter Thread starter GF
  • Start date Start date
G

GF

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!
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top