Retrieve the value of a checkbox

Topics: Developer Forum
Nov 4, 2010 at 4:21 PM
Edited Nov 4, 2010 at 4:39 PM

Hello everyone,

I have an excel file that I travel without any problem,.. well almost :/

In fact, I aim to get the value of my checkboxes. I tried ($sheet->getActiveSheet()->getCell('B1')->getValue()), but no result! I tried lots of other functions, but  I can't fix my problem

Someone already had this concern? And especially managed to solve?

Coordinator
Nov 5, 2010 at 12:55 AM

Form elements (including checkboxes) are not supported by PHPExcel. I'm not aware of any PHP reader for Excel files that provides access to form data in a workbook, other than using COM.

Nov 5, 2010 at 9:20 AM

Hi Mark, thanks!

Unfortunately, that's what I thought!

By the way, can you explain me what's COM? and how to use it? (or give me any links)

Coordinator
Nov 5, 2010 at 10:00 PM

COM is Microsoft's "Component Object Model", effectively a set of interface calls that allow external applications to interact with the internal components of MS applications, such as MS Office. It requires a copy of Excel installed on the server where you're running your PHP scripts, and you can then use PHP's COM extension to execute Excel functions. Details of the COM methods available within Excel are detailed on MSDN. Typically this would entail running your PHP scripts on a Windows server with Excel installed, although I have been advised that it is (theoretically) possible to use Open Office Calc (which also implements COM) and CORBA or XPCOM across a wider range of platforms.

Nov 8, 2010 at 8:48 AM

Well, OK Mark

I run my script on a Unix server, so I can't use COM. I'll try an other solution... or I'll negociate with my client ;)

Thanks