# Export query result set to excel file failed to open

**URL:** <https://forums.toadworld.com/t/export-query-result-set-to-excel-file-failed-to-open/49405>\
**Category:** Toad for Oracle & DevOps Toolkit\
**Created:** [March 25, 2020, 7:16pm UTC](https://forums.toadworld.com/t/export-query-result-set-to-excel-file-failed-to-open/49405 "2020-03-25T19:16:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![i-fan.l.kramer](https://avatars.discourse-cdn.com/v4/letter/i/e274bd/32.png) [@i-fan.l.kramer](https://forums.toadworld.com/u/i-fan.l.kramer)\
**Post date:** [March 25, 2020, 7:16pm UTC](https://forums.toadworld.com/t/export-query-result-set-to-excel-file-failed-to-open/49405/1 "2020-03-25T19:16:19Z")

</div>

When there are invalid characters (\< chr(31) or \> chr(127) in the result set, the export to excel will result in a not usable excel file.  
I know this is more or less an Excel problem. But the exact same query result can be exported to excel with no problem using a very old oracle tool called "GOLDEN" by Benthic software.  
I know I can also try to find the offending database field and fix the data albeit time consuming. But I cannot stop this from happening as users who input data into the database always find ways to insert invalid characters.  
Any solution for this?

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [March 25, 2020, 7:20pm UTC](https://forums.toadworld.com/t/export-query-result-set-to-excel-file-failed-to-open/49405/2 "2020-03-25T19:20:47Z")

</div>

Two possible workarounds:

1. If you are exporting to XLSX file, it might work exporting to XLS instead.
2. Try using the "Excel Instance" option in Export Dataset.

I will try to reproduce this and fix.

---

<div class="post-metadata">

**Author:** ![i-fan.l.kramer](https://avatars.discourse-cdn.com/v4/letter/i/e274bd/32.png) [@i-fan.l.kramer](https://forums.toadworld.com/u/i-fan.l.kramer)\
**Post date:** [March 25, 2020, 7:58pm UTC](https://forums.toadworld.com/t/export-query-result-set-to-excel-file-failed-to-open/49405/3 "2020-03-25T19:58:34Z")

</div>

1. I am using xlsx.
2. If I choose Excel instance, it won't let me create an output file. file browse option is grayed out.

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [March 25, 2020, 8:00pm UTC](https://forums.toadworld.com/t/export-query-result-set-to-excel-file-failed-to-open/49405/4 "2020-03-25T20:00:24Z")

</div>

I have never heard of the File Browse option being greyed out before. Does it always do that or just when this kind of data is present? I just tested Excel Instance with the following SQL and it worked for me. I was able to reproduce the problem with Excel File.

select chr(30) odd\_data  
from dual;

---

<div class="post-metadata">

**Author:** ![i-fan.l.kramer](https://avatars.discourse-cdn.com/v4/letter/i/e274bd/32.png) [@i-fan.l.kramer](https://forums.toadworld.com/u/i-fan.l.kramer)\
**Post date:** [March 25, 2020, 8:16pm UTC](https://forums.toadworld.com/t/export-query-result-set-to-excel-file-failed-to-open/49405/5 "2020-03-25T20:16:06Z")

</div>

only happens if I choose Excel Instance as you suggested. The output box is all grayed out except for the check box for Allow empty file.

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [March 25, 2020, 8:16pm UTC](https://forums.toadworld.com/t/export-query-result-set-to-excel-file-failed-to-open/49405/6 "2020-03-25T20:16:35Z")

</div>

Oh, you mean in Toad. yes, you have to save the file in Excel if you choose that option.

The Excel Instance option in Toad sends the data to directly to the Excel application, not through a file.
