Click here to Skip to main content
15,904,497 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have an vb.net application which interacts with an excel file and gets the data from it and write them into an text file. When i run my project code, it is running successfully and writes the data into a text file from excel.

But when i run the EXE file directly, it is showing an error, "object reference not set to an instance an object". The same error occurred when i prepare and run the setup of the project.

Please can anyone share your ideas to troubleshoot this issue.

Thanks,
Sivakumar.M.
Posted

Most probably, the file path to the excel may be incorrect.
Check if this is working correctly.
 
Share this answer
 
object reference not set to an instance an object
This Occurs probably when object is not initialized or Having null value.

Check this for all your objects in all the way
Which may Solve your Problem.
 
Share this answer
 
v2
to Further Abhinav's answer also check

1. Excel is installed on the machine and referenced properly
2. the path to the excel file that you are extracting data from is correctly setup
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900