Hello John,
it was taking several minutes to produce instead of maybe 15
seconds. The problem then disappeared and the system has
been running well.
According to the description, can I understand that the low performance
issue *ONLY* occurs at the first run of the application after a system
reboot? Is that to say your automation client can always run in an
acceptable speed after this first run? If you close the application, ensure
that excel.exe process does not exist in your Windows Task Manager, then
start the application again, does it run slowly? Do you have office 2007
SP1 installed on the Windows Vista system?
In my opinion, there are four possible reasons that make your application
slow:
1. It is slow when create the Excel application object:
When the application is run for the first time, it needs to create the
Excel application object: CreateObject("Excel.Application"). This process
usually may take a few seconds, but not several minutes. The application
should be invisible after it is created. Did you make it visible?
2. It is slow when open an Excel workbook
At the first run of the application, I wonder whether you created a new
workbook or opened an existing one? If you opened an existing workbook, did
the workbook contain a lot of data?
3. It is slow when retrieving data from data source
According to your first message, you extracted data from a database. Is it
possible that the database was restarted, and it was slow to retrieve data
after the restart?
4. It is slow when insert data into the worksheet.
According to your description, there is no formula column, no chart, no
macro existing in the worksheet, right? According to the responses from
Excel product team, most of the low performance when updating data in
worksheet is because the time spent drawing the statusbar and repainting
the screen has gotten slower. Here are a few more suggestions that can
improve the performance even if the visibility of the Excel application is
false:
a). Setting Application.ScreenUpdating to FALSE will speed
things up dramatically.
b). Turning off the Page Breaks makes a dramatic improvement
if they are on (have to turn off each time they get turned back on).
http://support.microsoft.com/default.aspx?scid=kb;EN-US;199505. Usually, if
you format the workbook and utilize the PageSetup object, the Page Breaks
will be turned on and slow the performance. Have you ever used PageSetup
object or formatted the workbook in your application?
c). creating an array and enter it into the cells all at one
time. This would be much faster than entering data in one piece at a time.
In order to determine which reason (1,2,3 or 4) slows your application, my
suggestion is that we could pop out a message when each phase is finished
in your application. Or we could calculate the time used for each phase by
timeEnd - timeStart, where timeEnd is the DateTime.Now when the phase ends,
and timeStart is the time when the phase starts. Please do the test and let
me know which phase makes your application slow. Would you send some sample
codes to my mailbox so that I can have a clearer picture of the procedure
that you import data into worksheets.
Last but not least, I hope to let you know that troubleshooting such issues
in newsgroup might not be the best channel due to the low efficiency when
we exchange the information. However, I will try my best to help you. If
you feel the issue is critical, I suggest that you could contact our
Product Support Services. The problem can be quickly and effectively
resolved with the direct assistance from a Microsoft Support Professional.
You can contact Microsoft Product Support directly to discuss additional
support options you may have available, by contacting us at 1-(800)936-5800
or by choosing one of the options listed at
http://support.microsoft.com/common/international.aspx?rdpath=fh;en-us;cntac
tms.
Regards,
Jialiang Ge (
[email protected], remove 'online.')
Microsoft Online Community Support
=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.