write to existing xls file and set filename when creating new

Topics: Developer Forum, Project Management Forum, User Forum
Feb 12, 2013 at 1:12 PM
I ahve two questions how do i write to an existing xls file

and how do i set the filename and path where to save. I have tried the example here but it saves the xls file to the same filname as the php file where the code is written. I want to set that the file i saved Documents/filename.xls
Coordinator
Feb 13, 2013 at 10:45 AM
The Writer's save() method takes one argument: a filename. You can set that filename to whatever value you want, in exactly the same way you would define a filename when doing a standard fopen() in PHP; so if you want it saving as Documents/filename.xls, then you'd call
$objWriter->save('Documents/filename.xls');
If a Documents/filename.xls file already exists, then it will be overwritten