View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Arif Ali[_2_] Arif Ali[_2_] is offline
external usenet poster
 
Posts: 16
Default VBAProjects remain in memory after workbook is closed

Nick,

1. Bookname is variable I created. May No longer be needed.
2. THe places where I expect WB's to be closed are where I open, or create
a new, WB and then close it. The simplest example when the user clicks the
ViewQuoteSummaryButton, the InitQuoteSummary routine opens quotesummary.xls,
populates a listbox, and close quotesummary.xls. Then the listbox is shown
until they close it.
3. The initquotesummary could be renamed since its purpose changed slightly
since it was created. It could be called populate_QS_List.
4. Fair enough about the confusion...ThisWorkbook.oExcel was put in since
oExcel is defined in ThisWorkbook section of the project, whereas some of the
subroutines are part of the UserForm object.

Barring any revelations you might have, I will probably strip down this code
and remove all WB-related subs, clean up the code, and then add them back in
one at a time. This program has evolved over time and could use a little
cleanup.

Arif
"NickHK" wrote:

- My version of Excel (2K) does not have ThisWorkbook.BookName, so I guess
it is custom property ?
- Range("C17..I17") cannot be valid; 2 x "."
- Which line do you expect the workbook closed and the project to disappear
from from the VBA IDE ?
- You don't need all those .Activate and .Select. Just work with the WB/WS
reference. These are mixed with oExcel.<Property and ActiveCell, so it
confusing what you are referencing.
- What is the routine "InitQuoteSummaryWindow" supposed to achieve ?
- I don't understand why you need lines like
"ThisWorkbook.oExcel.GetSaveAsFilename(..."

NickHK

"Arif Ali" wrote in message
...
Yes all the code is in the workbook. I only added the oExcel as a result

of
the problems I was having.

Although the "Set oExcel = nothing" is not shown (I just recently added it
to the workbook "BeforeClose" event) remember that many workbooks get

opened
and closed during the use of this application. Those are the ones I am
seeing stuck in memory.

In other words, does it really matter that I am not setting oExcel to
Nothing, if the problems that I am seeing occur before I expect to release
oExcel? Would it help for me to clarify further the operation of my book?