php - How to solve the error-Error loading file "Excel2007": Could not open Excel2007 for reading! while reading excel file using PHPExcelFile? -


  try {$ inputFileType = PHPExcel_IOFactory :: identity ('myfile.xlsx'); $ ObjReader = PHPExcel_IOFactory :: createReader ($ inputFileType); $ ObjPHPExcel = $ objReader-> Load ($ inputFileType); } Hold (exception $ E) {dead ('Error loading file'. 'Pathinfo ($ inputfile type, pathhinfo_ BASENAME).' ':'. $ E-> getMessage ()); } $ RowIterator = $ objPHPExcel- & gt; GetActiveSheet () - & gt; GetRowIterator (); $ Array_data = array (); Forex Currency ($ line indicator as $ line) {$ celliter = $ line-> Millicilator (); $ CellIterator- & gt; SetIterateOnlyExistingCells (wrong); $ RowIndex = $ row- & gt; GetRowIndex (); $ Array_data [$ rowIndex] = Array ('A' => gt; '' 'B' = 'gtc:' 'C' '=' gt; '', 'D' = & gt; E '=>' ',' F '=> gt;' G '=>' '); Foreign currency ($ cell ifrator $ cell) {If ('a' == $ cell- & gt; mill column ()) {$ array_data [$ rowIndex] [$ cell-> Get column ()] = $ cell-> Meet CalculateValue); } And if ('b' == $ cell- & gt; mill column ()) {$ array_data [$ rowIndex] [$ cell- & gt; Get column ()] = $ cell-> Receive unauthorized value (); } And if ('c' == $ cell- & gt; mill column ()) {$ array_data [$ rowIndex] [$ cell-> Get column ()] = $ cell-> Receive unauthorized value (); } And if ('d' == $ cell- & gt; mill column ()) {$ array_data [$ rowIndex] [$ cell-> Get column ()] = $ cell-> Receive unauthorized value (); } And if ('e' == $ cell- & gt; mill column ()) {$ array_data [$ rowIndex] [$ cell- & gt; Get column ()] = $ cell-> Receive unauthorized value (); } And if ('f' == $ cell- & gt; mill column ()) {$ array_data [$ rowIndex] [$ cell- & gt; Get column ()] = $ cell-> Meet CalculateValue (); } And if ('g' == $ cell- & gt; mill column ()) {$ array_data [$ rowIndex] [$ cell-> Get column ()] = $ cell-> Receive unauthorized value (); }  

Do not try to open a file named Excel2007 ( Value of $ inputFileType ) when your file is myfile.xlsx

  $ objPHPExcel = $ objReader-> Load ('myfile.xlsx');  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -