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 Excel Closing Problem

Hi Kan

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")
WB.Close False
End Sub

The VBAProject are still been seen in the VBE
Use this then

Sub test()
Set WB = Workbooks.Open("c:\data\ron.xls")
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



"Him_B" wrote in message ...
Dear those Excel Experts,

I have a problem related to the excel application closing
problem. I have created a excel filewith 4 userforms, 4 worksheets and some
Marco on it. If I close the file but not to quit the excel application, the
VBAProject are still been seen in the VBE. I open the file again in this
circumstance, the Marco can not run properly. In other case, if I quit the
excel application when I close the file, It will have no problem. Can
anybody tell me why and how to solve it.
Many Thanks,
Kan