Skip to Content
Author's profile photo Lavanya A

How to avoid Warning message after downloading to Excel

Hello everyone,

  I have always faced the issue of warning message “The file you are trying to open, ‘filename.xls’ is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?” while downloading data to excel sheet from internal table.

Finally I came across a solution which helped me get rid of this warning.Even though it is not a permanent fix, this can be used in some cases.

Do the following steps:

  1. Open your Registry (Start -> Run -> regedit.exe)
  2. Navigate to HKEY_CURRENT_USER\SOFTWARE\MICROSOFT\OFFICE\12.0\EXCEL\SECURITY
  3. Right click in the right window and choose New -> DWORD
  4. Type “ExtensionHardening” as the name (without the quotes)
  5. Verify that the data has the value “0″

This helped me resolve the issue.Hope it will be useful for some of you guys.

Regards

Lavanya

Assigned tags

      5 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Matthew Billingham
      Matthew Billingham

      Avoiding the message would mean creating a properly structured Excel file. All you are doing is suppressing the message.

      What are the contents of the file you've generated. Is it actually a fully structured Excel spreadsheet, or just CSV (or tab delimitted) with an xlsx or xls extension?

      If the latter,then there are at least two issues

      1. In a commercial environment, I can't imagine the network guys modifying everyone's registry so the error is suppressed
      2. It will affect all Excel spreadsheets, not just those generated by SAP
      Author's profile photo Jelena Perfiljeva
      Jelena Perfiljeva

      I'm guessing it's because when you do export to spreadsheet in SAP it still creates that "fake xls" format that is actually a text file. At least in the older releases. I wish SAP would solve this and create valid XLSX because people like their spreadsheets and there is no point to fight that.

      But brutally disabling the message is like using decapitation as a cure for migraine IMHO. +1 to Matthew here.

      Author's profile photo Dominik Di Lorenzo
      Dominik Di Lorenzo

      I absolutly agree that disabling the warning is a dangerous workaround.

      We have this problem here too, that Jelena describes and I think is what Lavanya tries to fix.

      I tell everyone who asks about that message to use the extension CSV, which is in my opion the right one.

      At least the client systems here use Excel for opening CSV-Files by default, so everything works fine with that extension.

      Author's profile photo Kiran K
      Kiran K

      Folks,

      https://archive.sap.com/discussions/thread/2116305

      Is this anyway linked to DC30.In my system also when we download excel file with .XLS or .xls it is opening but with an error message pop up.While browsing through different threads stumbled upon the above mentioned thread.When I checked DC30 in my system in the Development Server,I don't see any entry for Excel extensions in any of the three folders(in DC30).

      What exactly is DC30 for ?

      Is it anyway linked to pre define only certain extensions to files that are getting downloaded from SAP ?

      Thanks,

      K.Kiran.

       

      Author's profile photo AshiqAli Ratnani
      AshiqAli Ratnani

      A working solution is at the below link

       

      https://quick-drop.blogspot.com/2021/07/sap-abap-generating-xlsx-file-for.html