Solved

Making VBPogram more efficient

Posted on 2004-10-21
7
173 Views
Last Modified: 2010-05-02
Hi,

In my vb program in every form I am opening an excel workbook and reading/writing into it.
It is necessary as in every form i have to do different functions.

Now I notice that after i installed it on another computer(700MHz processor) it is extremely slow.
I have to increase the efficiency of the program.

But I am at loss.
Can u guide me here.

thanks a lot
0
Comment
Question by:SindhujaCheema
7 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 125 total points
ID: 12367877
Are you creating and/or modifying one workbook only? If so, than an obvious improvement would be to open or create it once and save and close it at the end of the application.
0
 
LVL 49

Assisted Solution

by:Ryan Chong
Ryan Chong earned 125 total points
ID: 12367906
Try modularise your codes if possible as you can, in other words, try reuse your code by writing function/sub

Is your process of reading/writing excel slow or the process of opening the form very slow?
0
 
LVL 10

Expert Comment

by:anv
ID: 12367911
what is the code u r using for reading from the excel file..

ur problem mainly is while reading excel or what??
0
 
LVL 5

Assisted Solution

by:IThema
IThema earned 125 total points
ID: 12369785
...I think the general problem is about 5 Excel-applications running at the same time at 10mb each...

Anyway, since you say you have each form reading AND writing to the workbook makes me think that each form also uses another workbook, since you cannot have two excel-processes to open the same workbook both in read/write mode. The second excel-process will open the workbook in read-only...

I think that the best thing to do is, to
- open ONE excel application as soon as it's needed and close/quit it as soon as possible.
- let each form open a different workbook als save/close it when the form quits (or earlier if possible). Note that one Excel-process can open different workbooks

Hope this helps,

Cheers...
0
 
LVL 1

Assisted Solution

by:scanadmin
scanadmin earned 125 total points
ID: 12370385
You could store the excel program instance variable as a global (in a module) then access that via the forms rather than open it every time.

just a thought

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now