Excel runs much slower in console app

Y

y2ksmith

Hi,

I've got an app that can either run with a GUI or in a console. The
app retrieves a report from Reporting Services and then merges it with
a Excel template. The code that processes the reports it's exactly
the same, whether you run with GUI or without. The problem is the
Excel automation code runs about 10 times slower in console mode. For
instance, the Workbook.SaveAs() method takes about a minute in console
mode and a few seconds in GUI mode. Again, the only difference
between the two modes is one shows a form the other displays a
console.

Any ideas would be much appreciated.

Thanks
 
Y

y2ksmith

Ok, just after I made the original post, I figured the problem out. I
needed to add Application.Run() (with no parameters), and then call
Application.Exit() when the reports finished processing. Must have
something to do with starting a message pump for the process.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top