Is there a way to import data from an Excel file into a datawindow through the powerscript code in a window object?
I want to have the user click on a command button, then in the powerscript code the data would be imported into the datawindow.
My application is set up meaning that I already have a datawindow that the columns match the columns in the excel file I want to import from. The excel file will be an xlsx or an xls type file. I can import the data successfully if I go through the Import-Export wizard. However, I don't want the user to have to use the wizard.
Preferably I would like the user to click on the command button and the data will automatically load into the datawindow. If anybody can give me an idea of what to do I would appreciate it.
If I could get an example of what to do, that would be great. Or, if there is a place in the documentation where I can see an example of how to do this, that would be good too.
Thank you in advance
and then with
dw_1.importclipboard()
you can import the data into your datawindow.
Heiko
dw_MyData.ImportFile(XLSX!, "myData.XLSX")
in my version, with the classical GUI, not .NET
and into the help documentation says
ImportFile method (DataWindows)
method (DataWindows)
Description
Inserts data into a DataWindow control or DataStore from a file. The data can be tab-separated text, comma-separated text, XML, or dBase format 2 or 3.
When I try to import with XLSX!, <<fileXLSXName>> I receive the error code -3 -> Invalid argument
This works properly in another version?
Any idea for do it this without export to CSV and import after...?