This project has moved. For the latest updates, please go here.

error reading .xslm files

Jan 17, 2011 at 1:42 PM

Hi,

 

I have some .xslm files which have visible, hidden, very hidden sheets in them.

 

I don't care about very hidden sheets and my program can just ignore them. But I should be able to read the visible sheets, but EPPlus just does not work.

 

Is there a way to read these kind of files?

 

Thanks

Srikanth Kambhampati

Coordinator
Jan 17, 2011 at 8:13 PM

This is a bug, I'll add a fix for it.

If you need a fix now,try this to replace the Hidden-Get ...

get 
{
  XmlElement sheetNode = xlPackage.Workbook.WorkbookXml.SelectSingleNode(string.Format("//d:sheet[@sheetId={0}]", _sheetID), NameSpaceManager) as XmlElement;
  if (sheetNode != null)
  {
     string state=sheetNode.GetAttribute("state");
     if (state == "hidden")
     {
       return eWorkSheetHidden.Hidden;
     }
     else if (state == "veryHidden")
     {
       return eWorkSheetHidden.VeryHidden;
     }
   }
   return eWorkSheetHidden.Visible;
}

 

Jan 21, 2011 at 4:22 PM

Hi Jan,

 

I tried to add this code and it actually worked reading the sheets.

 

But there was another issue with the relId because the very hidden sheets have this value set to empty string and EPPlus breaks at other points.

 

Can you look into that issue, and fix it?

 

Thanks

Srikanth Kambhampati