Importing Excel File

7 posts / 0 new
Last post
Bobby
Offline
Joined: 12/10/2015 - 04:44
Importing Excel File

Hello everybody,
it is actually the first time that I use IDEA for programming. Brian, I have had a look at your script which allows to import multiple Excel files from one folder into IDEA. Unfortuately, I could not solve my problem.
I recorded a macro in IDEA allowing to import just a single Excel file.
Function ExcelImport Set task = Client.GetImportTask("ImportExcel") dbName = Client.LocateInputFile ("I:\Team Pp-Shf-Sob-Ava\Teammitglieder\Voith\IDEA Makro Lam\Originaldaten\Unverkäuflichkeitsanalyse.xlsx") task.FileToImport = dbName task.SheetToImport = "excel für IDEA" task.OutputFilePrefix = "Unverkäuflichkeitsanalyse" task.FirstRowIsFieldName = "TRUE" task.EmptyNumericFieldAsZero = "FALSE" task.PerformTask dbName = task.OutputFilePath("excel für IDEA") Set task = Nothing Client.OpenDatabase(dbName)End FunctionI would like to have a dialog box, which allows me to select the respective Excel file since the macro shall be used for various clients. Only the first worksheet in the Excel file shall be imported. In the example its name is "excel für IDEA".
After all, it is important, that the imported Excel sheet is named "Unverkäuflichkeitsanalyse-excel für IDEA" in IDEA, since I am going to apply other makro on it.
Could anybody help me in solving this problem. It is greatly appreciated.
Greetings from Germany,
Bobby
 

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi Bobby, that would be a simple script.  Which version of IDEA are you using as V9 has additional functions for selecting files that are not available in V8.

Bobby
Offline
Joined: 12/10/2015 - 04:44

Hi Brian,
thank you very much for your quick response. I am on IDEA Version 8.0.5.243.
Best wishes
Bobby

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi Bobby, do you want to try this one out.  It might take some tweeks as I have V10 on my machine so you might a syntax error on some items but hopefully it will work for you.

Let me know.

Brian

Bobby
Offline
Joined: 12/10/2015 - 04:44

Hello Brian, thank you very much for your quick response. Your script works fine on Version 8.5 as well. I will include it in the makros that I have prepared and hopefully, it will work out!
Take care.
Bobby

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi Bobby, glad to help.

Lois's picture
Lois
Offline
Joined: 02/14/2013 - 09:00

Hello Brian,
I used the script Import Multiple Files for importing multiple CSVs. However, my challenge is that even though I created an RDF file by importing one of the files, subsequent imports using the script gives empty records for all the tables in IDEA.
In addition, I am dealing with hundreds of CSVs which I must merge into a single file. Is there a way I can immediately merge the multiple CSVs at the point of import?
Thanks for your time.
Lois