Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Not enough memory to run Microsoft Excel. Please close other applications and try again

Not enough memory to run Microsoft Excel. Please close other applications and try again

Scheduled Pinned Locked Moved C#
csharpperformancehelpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gauthee
    wrote on last edited by
    #1

    Hi, We have a windows application developed using c#. We have a process in this application where excel objects are created some data is populated and some calcualtions are done too (used various excel objects like workbook, sheet, range). The required tasks are being executed fine but there are instances where the same tasks fail. An error is being thrown at that time and it is "THERE IS NOT ENOUGH MEMORY TO RUN MICROSOFT EXCEL. PLEASE CLOSE OTHER APPLICATION AND TRY AGAIN" The error is pointed to Excel object creation and it shows - "An unhandled exception of type System.Runtime.InteropServices.COMException occurred in application_name.exe" What could be the cause for the error? Please provide some suggestions. Thanks

    gauthee

    M 1 Reply Last reply
    0
    • G gauthee

      Hi, We have a windows application developed using c#. We have a process in this application where excel objects are created some data is populated and some calcualtions are done too (used various excel objects like workbook, sheet, range). The required tasks are being executed fine but there are instances where the same tasks fail. An error is being thrown at that time and it is "THERE IS NOT ENOUGH MEMORY TO RUN MICROSOFT EXCEL. PLEASE CLOSE OTHER APPLICATION AND TRY AGAIN" The error is pointed to Excel object creation and it shows - "An unhandled exception of type System.Runtime.InteropServices.COMException occurred in application_name.exe" What could be the cause for the error? Please provide some suggestions. Thanks

      gauthee

      M Offline
      M Offline
      mav northwind
      wrote on last edited by
      #2

      Hi! With this degree of information it's really hard to give you the exact reason for your problem, but I think most likely it's due to resource leaks. Does it work again after restarting your application (and Excel)? Does it fail on first run or after a while? Do you release all the COM objects your app creates?

      Regards, mav -- Black holes are the places where God divided by 0...

      G 1 Reply Last reply
      0
      • M mav northwind

        Hi! With this degree of information it's really hard to give you the exact reason for your problem, but I think most likely it's due to resource leaks. Does it work again after restarting your application (and Excel)? Does it fail on first run or after a while? Do you release all the COM objects your app creates?

        Regards, mav -- Black holes are the places where God divided by 0...

        G Offline
        G Offline
        gauthee
        wrote on last edited by
        #3

        mav, Thanks for the reply! Sorry, if the info provided was unclear, what else you would require to analyze further? The other details are as follows: 1.When the error occurs we no longer can open an excel file. 2.After the system restart the excel application work. 3.Strangely the error(not enough memory) willnot occur when the number of processes running in my machine are minimal, when i run more applications/processes in my system this exce memory error occurs. 4.all COM objects related to excel are being released(not 100% sure though). we are searching for any excel processes running and then doing the kill process too! Thanks!

        gauthee

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups