Exe file Error HResult 0x8002000B, Invalid Index

2

Possible Duplicate:
How to run a C# .exe file on many computers?

I have a problem with my executable file. I made in C# windows forms to convert from txt to excel. Then in debug i took exe file there. In my computer with .NET 40 and Excel 2010 i got no problem at all. But when i tried it in my another laptop it shows me Invalid Index HRESULT 0x8002000B. There is office 2010 but no visual studio 2010 . How can i fix it? Is the problem because there is no Visual Studio Installation, if so how can i make executable file with all library?

c#
indexing
exe
hresult
asked on Stack Overflow Dec 5, 2012 by Le Viet Hung • edited May 23, 2017 by Community

3 Answers

2

This error happens when other computer doesn't have the target .net. If you publish your application and install it via setup file you can prerequisite targeted .net framework. Before setup it will check if computer has .net or not. If doesn't have it will advise to install it.

answered on Stack Overflow Dec 5, 2012 by Oktay
1

Go to Project--> properties--> publish --> prerequisites Be sure that targeted framework is a prerequisite and chose a location and publish it. your setup file is ready for all windows computers...+

answered on Stack Overflow Dec 6, 2012 by user1874941
0

After research on internet and asking friends, now i know why i got this problem. I tried with setup but it doesn't work, give me same error with invalid index.

The problem is with excel option, some users set up excel worksheetsnumber to 3, some to 1 ... By default is always 3. But if the user change it to 1 and in my C# i don't add new Worksheet but just get_item, so it will give me an error with invalid index. So i solve it with delete all worksheets in workbook in my C code, then add new Worksheets.

Thanks you guys for helping me, if someone convert or export from excel to txt, pdf or something else, please remember that default is 3 worksheets, but the user can change it and you got Error 0x8002000B :)

answered on Stack Overflow Dec 6, 2012 by Le Viet Hung

User contributions licensed under CC BY-SA 3.0