help in manipulating 2 files

Topics: Developer Forum, User Forum
Apr 30, 2009 at 5:53 AM
i have two files. file1 will serve as my source file and the other (file2) will serve as the destination file.
i will copy the contents of a particular sheet in file1 and paste it into the last row a particular sheet in file2.
can someone pls give me a sample code for this?
thanks in advance!

Apr 30, 2009 at 9:39 AM
this has been solved...
Apr 30, 2009 at 9:04 PM
I am trying to do the same thing and am looking for sample code.
I have a template source file, which includes macros, that I want to appear in a new file.

In other words, I want to open a "template" file that can be used to generate a "report" file over and over again, having the "report" file always containing the "template" file macros.

is this possible?

e.g.

// get the source template
$sourceFile = read(  $templateFileName );   

// create a new excel file, and set its data = template data
$destFile->setData( $sourceFile->getData() );

// add what I need to add to the new file
$destFile->writeAFewNewCells( ... )

$destFile->close();

thx!

JJC
Developer
May 1, 2009 at 5:25 AM
@jjciii: You can generate Excel files from templates the way you describe, but macros are unfortunately not supported.