Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-09-2023, 12:50 AM
ArviLaanemets ArviLaanemets is offline Do VBA Projects remaining visible in VBAProject window after they are closed matter somehow? Windows 8 Do VBA Projects remaining visible in VBAProject window after they are closed matter somehow? Office 2016
Expert
Do VBA Projects remaining visible in VBAProject window after they are closed matter somehow?
 
Join Date: May 2017
Posts: 873
ArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud of
Default Do VBA Projects remaining visible in VBAProject window after they are closed matter somehow?

This is linked to my previous post.

I open in my Excel app sequentally other workbooks (currently in same instance), do something, and then close them. After the workbook is closed, the VBAProject of closed Excel file remains displayed in VBAProject window of my App.

Does this mean, that those closed files are using up some of RAM? Because the number of files to be processed this way is currently about 1000, and my App crashed after ~300 of those secondary files were processed.

(As afterthought, when this is the cause, then I probably have to open all secondary files in separate instance, and to clear this secondary instance every time a secondary workbook is closed there)
Reply With Quote
  #2  
Old 10-09-2023, 09:33 PM
Guessed's Avatar
Guessed Guessed is offline Do VBA Projects remaining visible in VBAProject window after they are closed matter somehow? Windows 10 Do VBA Projects remaining visible in VBAProject window after they are closed matter somehow? Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

This is not the behaviour I would be expecting. Once you close the workbook, the document should disappear from your VBA window too.

Perhaps you could post the code you are using to open and close the workbooks. You may also have other code running (eg in Personal workbook) that is doing something to your VBA environment.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 10-13-2023, 12:35 AM
ArviLaanemets ArviLaanemets is offline Do VBA Projects remaining visible in VBAProject window after they are closed matter somehow? Windows 8 Do VBA Projects remaining visible in VBAProject window after they are closed matter somehow? Office 2016
Expert
Do VBA Projects remaining visible in VBAProject window after they are closed matter somehow?
 
Join Date: May 2017
Posts: 873
ArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud of
Default

It looks like this won't affect the performance, but there is another annoying effect.

Excel (as many other applications) has a feature, where when you want to open a file, you can select from files lately opened with this program. When I run this workbook and process through ~1000 Excel workbooks in folder (without saving there anything), all those ~1000 forkbooks are listed as top of this selection list. I.e. any user who will work with this app, will get his/her latest opened workbooks list spammed with those.
Reply With Quote
  #4  
Old 10-15-2023, 04:18 AM
p45cal's Avatar
p45cal p45cal is offline Do VBA Projects remaining visible in VBAProject window after they are closed matter somehow? Windows 10 Do VBA Projects remaining visible in VBAProject window after they are closed matter somehow? Office 2021
Expert
 
Join Date: Apr 2014
Posts: 871
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

Quote:
Originally Posted by ArviLaanemets View Post
all those ~1000 workbooks are listed as top of this selection list. I.e. any user who will work with this app, will get his/her latest opened workbooks list spammed with those.
Check out Application.RecentFiles.
The single line:
Application.RecentFiles(1).Delete
removes the most recently added recent file entry.
Perhaps you could add this line within each iteration of your loop?
Reply With Quote
  #5  
Old 10-15-2023, 10:30 PM
ArviLaanemets ArviLaanemets is offline Do VBA Projects remaining visible in VBAProject window after they are closed matter somehow? Windows 8 Do VBA Projects remaining visible in VBAProject window after they are closed matter somehow? Office 2016
Expert
Do VBA Projects remaining visible in VBAProject window after they are closed matter somehow?
 
Join Date: May 2017
Posts: 873
ArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud of
Default

Quote:
Originally Posted by p45cal View Post
Check out Application.RecentFiles.
The single line:
Application.RecentFiles(1).Delete
removes the most recently added recent file entry.
Perhaps you could add this line within each iteration of your loop?
It worked. Thanks!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Word 2013, when switching to next window, often opens it as a tiny window amz Word 1 04-20-2021 12:25 AM
How to call a function in VBAProject(PERSONAL.XLSB) coffent Excel Programming 0 05-17-2020 11:31 AM
How to show days remaining oliboi Excel 6 01-24-2019 10:29 AM
Word window empty when opened minimized while Visible is False qtutorm Word VBA 2 10-08-2018 09:10 AM
Time Remaining Progress Bar teza2k06 Excel 1 05-13-2014 05:41 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:16 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft