| Author |
Message |
pogoblue
Guest
|
Posted:
Wed Dec 29, 2004 10:32 pm Post subject:
Can't get Excel to unload...help! |
|
|
I have a unique problem that I just ran across. I have a routine which opens Microsoft Excel, performs a process using an Excel file, then closes the file, exits Excel, AND sets both container variables = nothing. However, Excel still will not leave memory. The only way to get it to leave memory is to unload the DVB file.
Now, when I try to unload the DVB file I have the following problems: when I hard-code a Application.UnloadDVB it fails for the obvious reason that it cannot unload itself. If I hard-code an Application.Sendcommand and use the VBAUnload command, it does not unload the file (resident on a network drive). If I program the VBAUnload command into the button that executes the DVB file, it never runs the command.
Anyone who has seen something like this and could provide a solution would be most helpful!
Thanks!
Jeremy
|
|
| Back to top |
|
 |
jim.dowthwaite@gmail.com
Guest
|
Posted:
Wed Dec 29, 2004 11:01 pm Post subject:
Re: Can't get Excel to unload...help! |
|
|
Jeremy,
You're not alone in this problem...it's been around for years. One
thing I found that usually works for me is to place the Excel code in a
class module (that you create and destroy properly). This get around
the unloaddvb issue.
Also, make sure you clear the worksheet, workbook and excel objects (in
that order).
Good luck,
Jim Dowthwaite |
|
| Back to top |
|
 |
Ed Jobe
Guest
|
Posted:
Wed Dec 29, 2004 11:07 pm Post subject:
Re: Can't get Excel to unload...help! |
|
|
Its not unique, to you that is. If you search this ng, (try "unload excel"),
you will find numerous discussions on the problem. The only thing that is
unique is that excell seems to be one of the few programs with this problem.
--
----
Ed
----
"pogoblue" <nospam@address.withheld> wrote in message
news:11346978.1104341593825.JavaMail.jive@jiveforum1.autodesk.com...
| Quote: | I have a unique problem that I just ran across. I have a routine which
opens Microsoft Excel, performs a process using an Excel file, then closes |
the file, exits Excel, AND sets both container variables = nothing.
However, Excel still will not leave memory. The only way to get it to leave
memory is to unload the DVB file.
| Quote: |
Now, when I try to unload the DVB file I have the following problems: when
I hard-code a Application.UnloadDVB it fails for the obvious reason that it |
cannot unload itself. If I hard-code an Application.Sendcommand and use the
VBAUnload command, it does not unload the file (resident on a network
drive). If I program the VBAUnload command into the button that executes
the DVB file, it never runs the command.
| Quote: |
Anyone who has seen something like this and could provide a solution would
be most helpful!
Thanks!
Jeremy |
|
|
| Back to top |
|
 |
Kevin L.
Guest
|
Posted:
Thu Dec 30, 2004 1:28 am Post subject:
Re: Can't get Excel to unload...help! |
|
|
and if your program stops for debugging or error out, Excel.exe will be in
the list of running processes, but not on the taskbar also...
kevin |
|
| Back to top |
|
 |
bcoward
Guest
|
Posted:
Sat Jan 01, 2005 6:22 am Post subject:
Re: Can't get Excel to unload...help! |
|
|
| You will find a Microsoft Knowledge Base article that will indicate using the Activate or Select methods helps cause this problem |
|
| Back to top |
|
 |
pogoblue
Guest
|
Posted:
Mon Jan 03, 2005 10:46 pm Post subject:
Re: Can't get Excel to unload...help! |
|
|
| Do you have a link for the article? I have not been able to come up with one using the search terms I can think of. Thanks! |
|
| Back to top |
|
 |
Paul Richardson
Guest
|
Posted:
Tue Jan 04, 2005 12:45 am Post subject:
Re: Can't get Excel to unload...help! |
|
|
goto the Web browser on autdesk's site to do your
search...
http://discussion.autodesk.com/thread.jspa?messageID=428916
and others...
"pogoblue" <nospam@address.withheld> wrote in message
news:5996131.1104774422908.JavaMail.jive@jiveforum2.autodesk.com...
| Quote: | Do you have a link for the article? I have not been able to come up with
one using the search terms I can think of. Thanks! |
|
|
| Back to top |
|
 |
Ed Jobe
Guest
|
Posted:
Tue Jan 04, 2005 12:56 am Post subject:
Re: Can't get Excel to unload...help! |
|
|
I think he was talking about the MS article that Bob referred to.
--
----
Ed
----
"Paul Richardson" <prichardson@adelphia.net> wrote in message
news:41d9a0ad$1_1@newsprd01...
| Quote: | goto the Web browser on autdesk's site to do your
search...
http://discussion.autodesk.com/thread.jspa?messageID=428916
and others...
"pogoblue" <nospam@address.withheld> wrote in message
news:5996131.1104774422908.JavaMail.jive@jiveforum2.autodesk.com...
Do you have a link for the article? I have not been able to come up
with
one using the search terms I can think of. Thanks!
|
|
|
| Back to top |
|
 |
Paul Richardson
Guest
|
Posted:
Tue Jan 04, 2005 1:19 am Post subject:
Re: Can't get Excel to unload...help! |
|
|
ah....I found this poking around..Interesting article
http://msdn.microsoft.com/library/default.asp?url=/archive/en-us/dnaraskdr/html/askgui05222001.asp
"Ed Jobe" <not.edljobe@hotmail.com> wrote in message
news:41d9a34d$1_2@newsprd01...
| Quote: | I think he was talking about the MS article that Bob referred to.
--
----
Ed
----
"Paul Richardson" <prichardson@adelphia.net> wrote in message
news:41d9a0ad$1_1@newsprd01...
goto the Web browser on autdesk's site to do your
search...
http://discussion.autodesk.com/thread.jspa?messageID=428916
and others...
"pogoblue" <nospam@address.withheld> wrote in message
news:5996131.1104774422908.JavaMail.jive@jiveforum2.autodesk.com...
Do you have a link for the article? I have not been able to come up
with
one using the search terms I can think of. Thanks!
|
|
|
| Back to top |
|
 |
pogoblue
Guest
|
Posted:
Tue Jan 04, 2005 2:29 am Post subject:
Re: Can't get Excel to unload...help! |
|
|
Latest update...I did some more poking around in my code and happened to notice that I did not use either the Activate or Select methods for any of my objects. I have read that you can run into this problem if you do not use absolute names with everything (i.e. Application.Worksheets.Sheet(1).Item...yada yada), but I believe the coding I have is as absolute as possible. The most confusing part is that a week before I ran into this error it did not occur, and the code was the same as it is now. Still researching on my end...any more help would be great: the articles have been especially helpful!
Thanks! |
|
| Back to top |
|
 |
pogoblue
Guest
|
Posted:
Tue Jan 04, 2005 2:59 am Post subject:
Re: Can't get Excel to unload...help! |
|
|
AHA!!! I found my loose reference: I used Workbooks.Open instead of MyXL.Workbooks.Open to open the Excel workbook that I needed to reference. Once I reran the routine Excel loaded into memory and then unloaded as it should. In the process of research, I found this interesting Microsoft Knowledge Base Article:
http://support.microsoft.com/default.aspx?scid=kb;en-us;199219
Which I believe could be useful for anyone else who encounters this problem. Thanks again for all of your help! |
|
| Back to top |
|
 |
|
|
|
|