# How to export data to existing Excel workbook?

**URL:** <https://forum.inductiveautomation.com/t/how-to-export-data-to-existing-excel-workbook/85343>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [February 7, 2024, 2:42am UTC](https://forum.inductiveautomation.com/t/how-to-export-data-to-existing-excel-workbook/85343 "2024-02-07T02:42:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [February 7, 2024, 2:42am UTC](https://forum.inductiveautomation.com/t/how-to-export-data-to-existing-excel-workbook/85343/1 "2024-02-07T02:42:23Z")

</div>

Hello all,  
If possible, I would like to export data from a named query to an existing Excel workbook.  
If not possible, I would like to export the same data to a new Excel workbook.

I have been playing with the `system.dataset.toExcel` function, but have not been able to get it to write a file to the specified directory.

This code `system.file.writeFile(filePath, spreadSheet)` is called from a button event, and presumably it runs the code, because I have a test line afterwards that fires.

I did ask about an error I had earlier while attempting to do this, which I had tagged my question onto this thread: [https://forum.inductiveautomation.com/t/perspective-table-excel-report/70598/4](https://forum.inductiveautomation.com/t/perspective-table-excel-report/70598/4)

Any ideas why Ignition will not write/create this file? I also created the file manually, thinking maybe it had to be there already, but no, no data was added to the file.

I even changed queries, just in case...

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [February 7, 2024, 2:51am UTC](https://forum.inductiveautomation.com/t/how-to-export-data-to-existing-excel-workbook/85343/2 "2024-02-07T02:51:13Z")

</div>

You're doing this on perspective? Then the save file function is trying to create a file on the gateway, does your Ignition gateway have write access for the folder you are trying to save the file to?

---

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [February 7, 2024, 4:51pm UTC](https://forum.inductiveautomation.com/t/how-to-export-data-to-existing-excel-workbook/85343/3 "2024-02-07T16:51:52Z")

</div>

Perspective, yes. Well, I did not realize it was trying to save it on the gateway, but one way or another I would like to get that file to the user's computer. So, are there any functions that save to the user's local hard drive?

Or, how would I get files saved to the gateway to my computer without having to have some sort of admin access?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 7, 2024, 4:56pm UTC](https://forum.inductiveautomation.com/t/how-to-export-data-to-existing-excel-workbook/85343/4 "2024-02-07T16:56:40Z")

</div>

> [@mdemaris](#):
>
> save to the user's local hard drive?

`system.perspective.download()`

Lots of examples on this forum.
