Re: Data transfer between Powerplant application and Excel sheet
Re: Data transfer between Powerplant application and Excel sheet
- Subject: Re: Data transfer between Powerplant application and Excel sheet
- From: Jon Pugh <email@hidden>
- Date: Sat, 9 Aug 2003 13:07:51 -0700
You are compiling your script every time. This is very slow.
Instead, you need to compile your script once and have it loop over the cells instead of looping in C and compiling a string every time through your loop.
Jon
At 10:57 AM +0530 8/9/03, Quark, India wrote:
>
I developing a software in powerplant, in which I am trying to write
>
the data generated to an Excel sheet. I use CAppleScript class
>
(downloaded from Metrowerks site) for executing the script. The script
>
that writes data to the Excel is generated dynamically (sprintf) as
>
shown below
>
The speed at which the data is transferred is very slow. Almost once
>
in 2 seconds I am getting an entry in the Excel sheet. Please provide
>
your suggestions to improve the speed of data transfer.
>
>
My code:
>
while(true)
>
{
>
\\ Script to open the Excel application comes here.
>
>
\\ Code that generates the 'xpressions' string comes here
>
>
\\ Embedding the data and the cell location into the script
>
sprintf(cmd, "\
>
tell application \"Microsoft Excel\"\r\
>
set location to string \"r\" & \"%d\" & \"c1\"\r\
>
Select Range location\r\
>
set FormulaR1C1 of ActiveCell to \"%s\"\r\
>
end tell\r", count, xpressions);
>
>
\\ Executing the script
>
CAppleScript openInFinderCmd(cmd, 0);
>
openInFinderCmd.Execute();
>
>
\\ Incrementing the cell count.
>
count++;
>
>
\\ Script to save and close the Excel application comes here.
>
}
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.