473,473 Members | 1,842 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Not Enough Memory to Start Excel

The program loops through a dataset and creates several spreadsheets
based on a change in a particular column. With each new spreadsheet I
launch a new instance of excel. After about 100 spreadsheets, a "not
enough memory to start Excel" displays. When I checked the Task
Manager I had plenty of memory available--I was only using 10% of the
memory available.

I am setting my objects to nothing and tried using GC.Collect() but it
did not fix the problem.

Thank you for any help.
Nov 20 '05 #1
3 2567

"Elliot" <es********@afgweb.com> wrote in message
news:e5**************************@posting.google.c om...
The program loops through a dataset and creates several spreadsheets
based on a change in a particular column. With each new spreadsheet I
launch a new instance of excel. After about 100 spreadsheets, a "not
enough memory to start Excel" displays. When I checked the Task
Manager I had plenty of memory available--I was only using 10% of the
memory available.


Doctor, it hurts when I when I hit myself in the face. What should I do?

Um. Well, hmmm. Well don't do that.

Seriously, would you ever even consider launching 100 instances of excel
from the start menu? No that's just silly.

Not that it's a good idea, but you could open 100 workbooks in ONE instance
of Excel.

Dim ex As New Excel.ApplicationClass
Dim ws As New ArrayList
For i As Integer = 1 To 500
ws.Add(ex.Workbooks.Add())
Next

That instance of Excel required about 40mb of memory for all those
workbooks.

David
Nov 20 '05 #2
I think this may be to do with GDI memory, not system memory. I would
suggest that you re-code it so as not to have 100 spreadsheets open at once,
why would you do this. ?

Try using ADO.NET to retreive the data you want to work on rather than
employing this method.

OHM


David Browne wrote:
"Elliot" <es********@afgweb.com> wrote in message
news:e5**************************@posting.google.c om...
The program loops through a dataset and creates several spreadsheets
based on a change in a particular column. With each new spreadsheet I
launch a new instance of excel. After about 100 spreadsheets, a "not
enough memory to start Excel" displays. When I checked the Task
Manager I had plenty of memory available--I was only using 10% of the
memory available.


Doctor, it hurts when I when I hit myself in the face. What should I
do?

Um. Well, hmmm. Well don't do that.

Seriously, would you ever even consider launching 100 instances of
excel from the start menu? No that's just silly.

Not that it's a good idea, but you could open 100 workbooks in ONE
instance of Excel.

Dim ex As New Excel.ApplicationClass
Dim ws As New ArrayList
For i As Integer = 1 To 500
ws.Add(ex.Workbooks.Add())
Next

That instance of Excel required about 40mb of memory for all those
workbooks.

David

Nov 20 '05 #3
* es********@afgweb.com (Elliot) scripsit:
The program loops through a dataset and creates several spreadsheets
based on a change in a particular column. With each new spreadsheet I
launch a new instance of excel. After about 100 spreadsheets, a "not
enough memory to start Excel" displays. When I checked the Task
Manager I had plenty of memory available--I was only using 10% of the
memory available.

I am setting my objects to nothing and tried using GC.Collect() but it
did not fix the problem.


After calling Excel's 'Quit' method, you can use this code to release
the reference to the COM object:

\\\
System.Runtime.InteropServices.Marshal.ReleaseComO bject(exApp)
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Tmenke | last post by:
Hello, I was wondering if anyone can help. I wrote a program in VBA. It does some calculations with matrices (arrays) . These arrays are dynamic and are sized according to a user defined input....
2
by: magnus | last post by:
Hi I´m trying to export a datatable to Excel. So far I have set up a file dump and can start Excel to read from that file. Now, my question is this: Since I have a stream, could I convert it to...
1
by: Ben | last post by:
I have written a procedure which calls the CORREL function of Excel to run correlation analysis on two arrays, then populate a table with the resulting correlation coefficient. This process loops...
2
by: Krish | last post by:
This is my first attempt, please bear. I referenced Excel 10.0 Object from VS .NET IDE, I think this creates Interop Object for Excel. I have the following code. ------code start---- ...
3
by: hari krishna | last post by:
hi, I am generating excel reports through vb.Net. After creating excel.application and the report is generated, each report leaves Excel in memory. I can see them in task manager in Process tab...
1
by: Michael Tkachev | last post by:
Hi Everybody, I created an Excel file in the ASP.Net. When I wrote this file on the disk I tryed to release COM objects. But I couldn't do it. When my method finished an "Excel" process exists...
8
by: Adrian | last post by:
Hi I have a JS program that runs localy (under IE6 only) on a PC but it has a memory leak (probably the known MS one!) What applications are there that I could use to look at the memory usage of...
4
by: Seok Bee | last post by:
Dear Experts, I have created a script to extract the Event Logs from the system into an excel sheet. The logs are separated into 2 worksheets (Application Log and System Log). After this excel...
22
by: Frank Rizzo | last post by:
I have an object tree that is pretty gigantic and it holds about 100mb of data. When I set the top object to null, I expect that the .NET framework will clean up the memory at some point. ...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.