Page 1 of 1

unable to read file from network folder \\myfolder\fi\a.xx

Posted: Thu May 29, 2008 6:08 am
by parvez mahmud
I have written a php script that read excel file ,write something on it and save as the file using a specific format.The script work fine in local machine.But when tried to the excel file from network folder for instance \\myroot\\template\\a.xls the scrips fails.I've used COM to access excel file.Can anyone have any idea.Plesae help me.I need solution badly. :cry:

Re: unable to read file from network folder \\myfolder\fi\a.xx

Posted: Thu May 29, 2008 7:49 am
by Jaxolotl
It's hard to find the solution with no code posted

Re: unable to read file from network folder \\myfolder\fi\a.xx

Posted: Fri May 30, 2008 3:12 am
by parvez mahmud
class ExcelWrite{
private $excel;
private $wkb;
private $sheet;
private $cell;

function OpenFile($fname){

$this->excel = new COM("excel.application");
//Keep Excel invisible
$this->excel->Visible = 1;
//Create a new workbook
//$wkb = $excel->Workbooks->Add();
$this->excel->DisplayAlerts = 0;
$this->wkb= $this->excel->Workbooks->Open($fname);
$this->sheet = $this->wkb->Worksheets(1);
$this->sheet->activate;
}

}

WriteToExcel($input,$output){
$extem=new ExcelWrite();
$extem->OpenFile($input)
}
$tempfilepath="C:\\Program Files\\Apache Group\\Apache2\\htdocs\\rndformfinal\\template.xls";
$exportfileapath="C:\\Program Files\\Apache Group\\Apache2\\htdocs\\rndformfinal\\Export\\" ;
WriteToExcel($tempfilepath,$exportfileapath);


No Problem.The scripts open the excel file.
But if
$tempfilepath="\\\\mynetwork\\template.xls;
$exportfileapath="mynetwork\\Export\\" ;
Then the script can't read the file from network.
Is there any solution for this.