Cari Blog Ini

26 Februari 2013

Warning: Object Invalid or No Longer Set


Apply in:
* Microsoft Visual Basic 6
* Microsoft Excel 2010
* Microsoft SQL Server 2008 R2


Problem: 
1. When run, an example application form, likely,

2. Then display the "Warning: Object Invalid or No Longer Set"



First condition of Code

1. In menu "Project > References", with using Microsoft Excel 2010.

2. The snippet of Code, that using Excel is



Causes: 
There is a different or invalid version of object in code for Microsoft Excel 2010. 

Note: 
* Microsoft Excel 2007 - using code = "Excel 5.0;"
* Microsoft Excel 2010 - using code = "Excel 8.0;"

* Microsoft Excel 2003 - using library = Microsoft Excel 11.0 Object Library
* Microsoft Excel 2007 - using library = Microsoft Excel 12.0 Object Library
* Microsoft Excel 2010 - using library = Microsoft Excel 14.0 Object Library


Solution: 

1. Rename code, where from "Excel 5.0;" become "Excel 8.0;" likely,



2. Make a new .exe of form 

3. Then try to run again the application,





Note-2:
The code above, is a snippet. So, you must check your code again.