Solved

Cleaning HD of consequences of VBA application object errors

Posted on 2013-05-25
6
555 Views
Last Modified: 2013-05-26
I'm learning to create Application interactions between MS Visio and Excel in early binding. When I started  creating application objects (visio, excel) I did not clean up the objects before closing, and Windows7 showed down a lot. Then I learned to clean up application objects before closing, eg in Visio code and for excel.application:
if NOT xlApp is Nothing then Set xlApp = Nothing

if Visio code creates xl.App and throws a bug before xl.App is cleaned up, does this adversely affect Windows7?

ought one to have
if NOT xlApp is Nothing then Set xlApp = Nothing in a beforeClose event in the visio ThisDocument module?

Finally, how does one maintain ones HD / Windows7 when these coding mistakes are made, and xlApp is not killed.

I try running the PC through Windows7 safe mode once or twice, and if that does not help speed up excel/visio, do a system restore to a restore point at which Windows was running faster.

What SHOULD I do?

Are there 'cleaning processes' I should use regularly in this connection?

Thanks
Kelvin
0
Comment
Question by:Kelvin4
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 17

Accepted Solution

by:
andrewssd3 earned 260 total points
ID: 39197597
This situation should not cause any lasting issues to your HD after a log-off log-on or a restart of the computer.  What does happen is that during one session you could get a lot of instances of Excel hanging around in the background using up resources.  You should be able to see these if you start Task Manager and look on the Processes tab. You can also kill them from here.  However they will go away after you log off.

The only permanent effect I could imagine is that starting Excel could become slow as it will warn you about lots of files needing recovery when you start anew session.

As you say it is definitely recommended to kill the instances when you are finished with them.  It is best to close any unsaved files, and use the xlApp.Quit method to ensure it goes away before setting to nothing.

You should also use error handling to ensure you do the close even if an error is raised.

For a comprehensive discussion (which may be over the top for your requirements), see this EE article http://rdsrc.us/TVnIgG
0
 
LVL 19

Assisted Solution

by:Ken Butters
Ken Butters earned 80 total points
ID: 39197603
I agree with andrewssd3.  In general the items you are referring to are more memory management issues than they are hard drive management issues.

You can however use a tool like http://www.piriform.com/ccleaner to clean up leftover files from various places on your hard drive.
0
 
LVL 25

Assisted Solution

by:Lionel MM
Lionel MM earned 80 total points
ID: 39197608
I have two suggestion 1) Ask that this question be moved to the coding section for experts there and 2) to use tools like CCleaner and glary utilities--these will address ystem issues and not coding issues. Hope that helps
http://www.piriform.com/ccleaner/download
http://www.glarysoft.com/glary-utilities/download/
0
 
LVL 70

Assisted Solution

by:Qlemo
Qlemo earned 80 total points
ID: 39197667
"Run in safe mode" and "performing a system restore" are in no way related to your application objects. As said by prior posts, the application objects are bound to the session, in memory, and cannot persist over a reboot or log-off.

IMHO the only issues you can get rid of with a system restore is
a) MRU list (most recently used files)
b) crash/file recovery info for Visio/Excel, as mentioned above.
The latter is usually fixed by starting the corresponding application once without any file, or with the file not closed properly.
0
 

Author Closing Comment

by:Kelvin4
ID: 39198022
Thank you all for useful education
Kelvin
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question