Making VBPogram more efficient

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
SindhujaCheemaAsked:
Who is Participating?
 
GrahamSkanRetiredCommented:
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
 
Ryan ChongCommented:
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
 
anvCommented:
what is the code u r using for reading from the excel file..

ur problem mainly is while reading excel or what??
0
 
IThemaCommented:
...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
 
scanadminCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.