Asp. NET export Excel prompt when opening: Specify file inconsistencies with file name extensions _ Practical Tips
Source: Internet
Author: User
"Export data from the GridView in the page to Excel table" encountered an error: C # export Excel file open Excel file format inconsistent with extension specified format. Specific hints as shown:
workaround : Use the "Modify registry" method to resolve this problem, which does not solve the root problem:
1, open Registry Editor method: Start-> run-> input regedit-> OK
2, find the registry subkey hkey_current_user\software\microsoft\office\12.0\excel\security
3, in the right margin, click the right mouse button, select "New-> DWORD Value (D)", enter "extensionhardening" click OK.
4, with the right mouse click Extensionhardening, and then click "Modify (M)", in the numerical data to fill in "0" can be determined.
5, close the Registry Editor, open the XLS again to see if the hint is not gone?
data settings for the value set by Extensionhardening :
* 0: Do not check the file name extension and file type and bypass the function's warning message.
* 1: Check file name extension and file type. If they do not match, a warning message is displayed.
* 2: Check file name extension and file type. Do not open the file if they do not match
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.