Hi Max,
Few things that straight away come to my mind are as follows:
- If you are trying to open and close excel a lot of times in your automation, avoid doing that as it can build up a lot of memory and can also result in memory leaks.
- Secondly, if you are using a lot of excel functions, think of a way if there is any chance where you can optimize the solution to just use collections and write it at once in the end. A lot of unnecessary issues can be avoided.
- Many times the second point is not possible to achieve. If that is the case, then you can perhaps create a custom object and use a simple code stage in one of the action that you create with the following code: GC.Collect()
This will forcefully invoke the .NET Garbage Collector which is generally invoked by the OS periodically. After closing the excel file instances, you can perhaps call this action to
reclaim memory which has been designated as available to be recovered.
------------------------------
----------------------------------
Hope it helps you and if it resolves you query please mark it as the best answer so that others having the same problem can track the answer easily
Regards,
Devneet Mohanty
Intelligent Automation Consultant
Blueprism 6x Certified Professional
Website:
https://devneet.github.io/Email: devneetmohanty07@gmail.com
----------------------------------
------------------------------
---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.