in reply to WIN32::OLE Excel Save As

You might have a look at Devel::DProf or Devel::Profiler. You could also sprinkle Time::HiRes in the code and see where it's taking the most time.

use Time::HiRes qw( gettimeofday tv_interval ); my $start_time = [gettimeofday]; # work hard printf "hard work took %.2f seconds\n", tv_interval( $start_time );

Replies are listed 'Best First'.
Re^2: WIN32::OLE Excel Save As
by smitty1624 (Initiate) on May 02, 2007 at 21:46 UTC
    I have added the Time::HiRes to my script and it printed out "work hard took 0.00 seconds".

    Could the delay that I am seeing be cause be calling the Excel app?

    When I change the file format to Save As a .csv file, it runs in seconds.

    Looking at the Devel::DProf & Devel::Profiler

      When I change the file format to Save As a .csv file, it runs in seconds.

      Well, that sounds pretty conclusive to me. Figuring out why Excel takes so long for the file you're giving it may be a pain, and I doubt that examining your own code further will help a whole lot. Time to ask someone who knows Excel somewhat better.

        Can you help out with where the best place to ask someone who is familiar with Excel?

        I have the script set up to have the user go through the Save As prompt in Excel, which is surprisingly faster then having the script do the Save As.