The format is inconsistent with the format specified by the file extension.

Source: Internet
Author: User

When using C # To export excel files, there is always a prompt:

The format of the file test.xls you try to open is inconsistent with the format specified by the file extension. Verify that the file is not damaged and the source is trusted before opening the file. Open the file now?

Click Yes to open it. However, this prompt is always displayed, which makes you feel uncomfortable.

Provides a solution that has been tested and is valid:

1. Close all office applications, open the registry, and enter regedit during running. You can use the shortcut key win + R to open the running window.

2. Locate HKEY_CURRENT_USER \ Software \ Microsoft \ Office \ 12.0 \ Excel \ Security

Click [new] on the [edit] menu, click the DWORD Value, ENTER ExtensionHardening, and press ENTER.

3. Right-click ExtensionHardening, click Modify, and enter 0 as the value. Click exit from the menu above.

 

Open the excel file and find that the prompt is missing.

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.