Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel Closing Problem

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Excel Closing Problem

Without seeing the code I would guess that a userform is still loaded into
memory. Make sure all forms are Unloaded after they are hidden. If a form
needs to remain loaded into memory so subsequent code can use its properties
or values, then perhaps Unload the form in ThisWorkbook Before_Close event.

Unload UserForm1

If this is not seemingly the problem, post your code for more help.
Mike

"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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel Closing Problem

Thanks Ron de Bruin and Mike,
I will try and tell you the result.
Kan
"Mike Fogleman" ¼¶¼g©ó¶l¥ó·s»D
...
Without seeing the code I would guess that a userform is still loaded into
memory. Make sure all forms are Unloaded after they are hidden. If a form
needs to remain loaded into memory so subsequent code can use its

properties
or values, then perhaps Unload the form in ThisWorkbook Before_Close

event.

Unload UserForm1

If this is not seemingly the problem, post your code for more help.
Mike

"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






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel Closing Problem

Ron de Bruin and Mike,
Both of your methods are in vain. However, I use the excel file
in other MS office computer but the problem is gone. I suppose that's the
problem in Excel. Hence I re-install MS office in my computer, the problem
disappear.
Anyway, Thanks again for your prompt reply.
Kan
"Him_B" ¼¶¼g©ó¶l¥ó·s»D
...
Thanks Ron de Bruin and Mike,
I will try and tell you the result.
Kan
"Mike Fogleman" ¼¶¼g©ó¶l¥ó·s»D
...
Without seeing the code I would guess that a userform is still loaded

into
memory. Make sure all forms are Unloaded after they are hidden. If a

form
needs to remain loaded into memory so subsequent code can use its

properties
or values, then perhaps Unload the form in ThisWorkbook Before_Close

event.

Unload UserForm1

If this is not seemingly the problem, post your code for more help.
Mike

"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








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Excel closing and restarting for no reason iamanangel Excel Discussion (Misc queries) 2 December 1st 08 04:07 PM
Problem when closing Excel 2007 and with Add-ins Gary Excel Discussion (Misc queries) 1 January 4th 08 01:02 AM
Problem closing Excel David Excel Discussion (Misc queries) 2 January 29th 06 01:02 AM
Problem in closing Excel App with translated excel macro Dasharathi K Excel Programming 0 September 19th 03 08:35 AM
Problem with closing the excel application guhan Excel Programming 1 August 20th 03 01:56 PM


All times are GMT +1. The time now is 06:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"