Here are the possible reasons and solutions iI can think of:
- The excelExcel file instance may be getting opened in the protectedprotected mode. Opening,opening saving, and closing them is solving this issue temporarily,but for fixing permanently. To fix it permanently, you need to add the excelExcel file location as a trusted one in the Trust centerCenter.
For doingTo do this, you need to gotogo to excel>>file>>options>>Trust center>>trust center settings>>Trusted locations.excel>>file>>options>>Trust center>>trust center settings>>Trusted locations.
and add the location of your excelExcel file there.
Another thing that you can try is changing the file block settings in the same options window for excelExcel 2007, and later file types according to your needs.
The last reason that iI can think offof is excel is unable to identify the type of value being inserted in the columns,thisExcel is unable to identify the type of value being inserted in the columns. This problem is resolved by entering some default sample values in the 1stfirst row for each column,this. This workaround helps excelExcel in deciding what kind of value is getting entered and most of the timestime fixes the format issue.
For example:
column1_has_to_get_integer_valuecolumn1_has_to_get_integer_value
then insert any integer value in first row.
column2_has_to_get_string_valuecolumn2_has_to_get_string_value
then insert any string value in first row.
Hope this helps.