-2

I have some VBA code taking data from an excel file and turning this data into Visio diagrams. There are over 3000 Visios to be made, so the code is just running in the background. The issue is that each Visio process stays running in the background stays running until I manually kill it through Task Manager. This will lead to memory issues if I don't manually kill them. Is there a cmd command or script that I can run which will kill all Visio processes that are taking up 0% CPU? Thanks!

PythonParka
  • 114
  • 1
  • 11

1 Answers1

0

I suppose you have in your code something like this :
Dim appVisio
Set appVisio = CreateObject("Visio.Aplication")
... your code ...
So you can instead use
Set appVisio = GetObject(,"Visio.Aplication")
This will use the same application instance instead of creating new ones
Then in the end of your script try
appVisio.Quit

Siyon DP
  • 534
  • 7
  • 15
  • Exactly, I have been using CreateObject. If I use GetObject, will this create 3000 separate Visio documents, or will it create 3000 sheets in the same document? Unfortunately they have to be 3000 separate ones. Thanks for your hep! – PythonParka Aug 24 '17 at 08:48
  • @Cormac `GetObject` will only effect application processes. in your application you can control the documents created and sheets thought the appropriate methods i.e in Excel you can use `appExcel.Workbooks.Add(fn)` and `wkb.Sheets.Add()` and similar methods in Visio – Siyon DP Aug 24 '17 at 10:50