I am trying to code a macro (I don't know if this name exists in english, but whatever) for Excel, and when I run it, I have this error that shows up :
check the ErrorCode property of the exception to determine the HRESULT returned by the COM object
With the additionnal information : Exception of HRESULT : 0x800A03EC
And I really don't know how to resolve this... I have tried a lot of answers from different forums, but nothing worked so far :(
Here is the part of my code where I get the error : (I will not paste everything as it is far too long)
if (PPE_ExcelFiles.dataWorksheet.get_Range(NOFEUIL_Column + noRowDataFile) != null) {...}
PPE_ExcelFiles
being another public Class I have made, and dataWorkSheet
is of the type Excel.Worksheet
. (And the type of what is inside the cell should be a string).
I have tried some other things, like :
string str = (string)PPE_ExcelFiles.dataWorksheet.get_Range(NOFEUIL_Column + noRowDataFile).Value;
if (str != null) {...}
And it didn't work either, receiving the same error, on the first line.
I don't know what kind of other informations you would potentially need to help me, as I really don't know what goes wrong, so tell me if there are some !
Thank you a lot
EDIT :
In the possible duplicate post, they say that it can occur if Excel can't find what we're asking it to. But that should not be the case for me :
noRowDataFile
= 2NOFEUIL_Column
= "G"PPE_ExcelFiles.dataworksheet
exists- the sheet has a value in [G,2]
.get_Range(string + int)
works wonders in another code