Open GoogleCodeExporter opened 9 years ago
This issue occurs in the "Name" getter of the "DirectoryEntry".
The condition for checking the "NameDataSize" returns an empty string if
"NameBuffer" contains only one char. So the "Members" Property throw an
Exception while adding a second DirectoryEntry with empty Name.
Original comment by sebge...@gmail.com
on 8 Jun 2011 at 8:33
and what is the solution?
Original comment by jazz.hek...@gmail.com
on 28 Mar 2014 at 3:48
For what it's worth...
I recently hit this same problem. I imagine there are multiple reasons why
this could happen. As the previous poster alluded, the error stems from the
initialization of a dictionary of component parts, the key to which is the
part's name. The exception is thrown when more than one part has the same name
(within the part's parent).
In my case, this situation was caused by the presence of VB forms in my file.
For reasons I never spent the time to completely understand, some of the
component parts of a form did not have names (the value was an empty string),
so when the second one for a given form was encountered, the exception was
thrown when an attempt was made to put in the dictionary. (By the way, I was
able to get this far only be downloading and stepping through the source code).
I was lucky in that I could request that the files be sent to me as .xlsm
instead of .xls, and as a result, I was able to use a different utility to
parse the file and problem solved (either because the new version of Excel
doesn't store its data this way or because the utility I am using is more
robust. Or both.)
Anyway, my fallback solution would have been to hack the source code to ensure
that every component part had a name to use as its key in the dictionary
(GUID). This was working for my particular problem, but I never got around to
investigating what the potential fallout would have been from doing such a
thing.
Original comment by rickus...@gmail.com
on 20 Aug 2014 at 9:18
Original issue reported on code.google.com by
cmy...@gmail.com
on 19 May 2011 at 4:59