Report from VB to EXcel

DONATUS
04-03-2003, 11:08 AM
I write macros in excel copy them and paste in the VB for writing a report in Excel from VB. which i find that to print a simple report in excel it takes a huge amount of time. the reason being in excel to print each value the cell has to be caught using range command and printed.

Is there any way to improve the timing in the excel report printing

Wamphyri
04-03-2003, 12:55 PM
There are a couple of ways. Some you can use others you may not be able to use.
1. You can optimize your existing excel code. I'd have to see your code to say for certain what needs to be done but look at using the With statement where possible. Also use Option Explicit and make sure you are not declaring anything as Variant or Object. Plus too many other things to list.

2. You could write the data first to a comma delimitted text file. Then open the comma delimitted text file with excel and format it as needed.


BTW the code generated from recording a macro is usually very inefficient.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum