Posted by Anuraj on Monday, July 1, 2013
Today I got another problem with Excel file opening. One of the my colleague wrote code to generate XLS / XLSX file using OleDb object. And it was working perfectly. Only problem, while opening the XLS / XLSX file, MS Excel was displaying an error like this.
And clicking Yes will open the file properly. The root cause of the problem was connection string. He wrote some code to identify x64 and x32 systems, and based on the platform, he was changing the connection string. For the x64 bit version his connection string was like this. And it was generating an XLSX file.
I modified the connection string like this.
And it worked. Microsoft also providing some solutions like changing the Group Security setting. After updating the registry setting you’ll not receive this error.