# \[ SOLVED \] Export csv error CREATED PROCESS ERROR=2

**URL:** <https://forum.inductiveautomation.com/t/solved-export-csv-error-created-process-error-2/76660>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [July 20, 2023, 4:20pm UTC](https://forum.inductiveautomation.com/t/solved-export-csv-error-created-process-error-2/76660 "2023-07-20T16:20:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Esmeralda\_Lopez](https://avatars.discourse-cdn.com/v4/letter/e/fbc32d/32.png) [@Esmeralda\_Lopez](https://forum.inductiveautomation.com/u/Esmeralda_Lopez)\
**Post date:** [July 20, 2023, 4:20pm UTC](https://forum.inductiveautomation.com/t/solved-export-csv-error-created-process-error-2/76660/1 "2023-07-20T16:20:49Z")

</div>

Hello,

I have this code in a button:

```auto
table =event.source.parent.getComponent("tblPedidoscabecera")
filePath=system.dataset.exportExcel("Estadisticas_Pedidos_Rutas_T. Pedidos_ Confirm. SAP.xlsx",1,table.data)
if filePath != None:
	system.net.openURL("file:///"+filePath.replace('\\','/'))'''

```

And when I clic on it, I got this error, this code should export a information from a table that is named as tblPedidoscabecera and then should open it but says this:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/7/171ce474d1871f61ceabf087c68c8fba4ce0a5ad.png)

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [July 22, 2023, 9:52am UTC](https://forum.inductiveautomation.com/t/solved-export-csv-error-created-process-error-2/76660/2 "2023-07-22T09:52:38Z")

</div>

What is the output or identical pseudo output for this:

```auto
table =event.source.parent.getComponent("tblPedidoscabecera")
filePath=system.dataset.exportExcel("Estadisticas_Pedidos_Rutas_T. Pedidos_ Confirm. SAP.xlsx",1,table.data)
print filePath

```

---

<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:** [July 22, 2023, 1:29pm UTC](https://forum.inductiveautomation.com/t/solved-export-csv-error-created-process-error-2/76660/3 "2023-07-22T13:29:22Z")

</div>

Your java install is asking your OS how to launch that file type, and your OS is saying to use `command.com`, the ancient predecessor to `cmd.exe`. You have an OS configuration error. Consider using java's `ProcessBuilder` to launch Excel's executable directly.

---

<div class="post-metadata">

**Author:** ![Esmeralda\_Lopez](https://avatars.discourse-cdn.com/v4/letter/e/fbc32d/32.png) [@Esmeralda\_Lopez](https://forum.inductiveautomation.com/u/Esmeralda_Lopez)\
**Post date:** [July 25, 2023, 1:34pm UTC](https://forum.inductiveautomation.com/t/solved-export-csv-error-created-process-error-2/76660/4 "2023-07-25T13:34:14Z")

</div>

I found the error, I just need to remove the ".xlsx" because I could not open the file after saving.  
By the way, I did not have the software to open the file.

```auto
table =event.source.parent.getComponent("tblPedidoscabecera")
filePath=system.dataset.exportExcel("Estadisticas_Pedidos_Rutas_T. Pedidos_ Confirm. SAP",1,table.data)
if filePath != None:
	system.net.openURL("file:///"+filePath.replace('\\','/'))'''

```
