How to read active-x control in excel using NPOI

Sep 13, 2013 at 4:24 AM
Edited Sep 13, 2013 at 4:28 AM
HI.........

I have a active-x checkbox control in my excel. I need to read the value of the active-x control i.e. the checkbox on the server...on my local machine as excel component is installed there is no issue to read the same but at the server there is no excel component installed.


Is there any way i can read the active-x check control without using ole-db or excel component at the server...

Following is the code i am using
        DataTable dt = new DataTable();
        HSSFWorkbook hssfworkbook;
        StringBuilder sb = new StringBuilder();
        using (FileStream file = new FileStream(FileName, FileMode.Open, FileAccess.Read))
        {
            hssfworkbook = new HSSFWorkbook(file);
        }
        int SheetCount = hssfworkbook.NumberOfSheets;

        for (int Loopvar = 0; Loopvar < 4; Loopvar++)
        {
            ISheet sheet = hssfworkbook.GetSheetAt(Loopvar);
            System.Collections.IEnumerator rows = sheet.GetRowEnumerator();
            while (rows.MoveNext())
            {
                IRow row = (HSSFRow)rows.Current;
                for (int i = 0; i < row.LastCellNum; i++)
                {
                    ICell cell = row.GetCell(i);
                    if (cell == null)
                    {
                        sb.Append("");
                        sb.Append("Æ");
                    }
                    else
                    {
                        sb.Append(cell.ToString());
                        sb.Append("Æ");
                    }
                }
                sb.AppendLine();
                //sheet = null;
            }
        }    
        return sb.ToString();
But when check box is there in the cell it is returning null value.....


Thanks in advance.....
Coordinator
Sep 18, 2013 at 5:40 AM
ActiveX control is not supported in NPOI