Hello Everyone,
I use IDEA frequantly and our end product always has to be in excel file. Is there any quick script I could put together which exports the currently active database into an excel spreadsheet on my computer without any dialog boxes? I would like the xlsx file to just retain the name of the active database open (.imb file). I recorded a scripted, but honestly, am not very good with scripting.
Could someone help me to modify it? I feel like 85% of the code is already there.
<code>
Sub Main
Call ExportDatabaseXLSX() 'file1.IMD
End Sub
' File - Export Database: XLSX
Function ExportDatabaseXLSX
Set db = Client.OpenDatabase()
Set task = db.ExportDatabase
task.IncludeAllFields
eqn = ""
task.PerformTask "C:\Data\Desktop\file1.XLSX", "Database", "XLSX", 1, db.Count, eqn
Set db = Nothing
Set task = Nothing
End Function
</code>
davidm
Offline
Last seen: 9 years 3 months ago
Joined: 01/13/2014 - 01:33
Hello David and welcome to the site.
Try this out and see if it fits your needs. There is a function Client.CurrentDatabase that gets the current database. I then extracted the name of the database and had to remove the IMD and replace it with the XLSX extenstion. When you run it, it should automatically save an Excel spreadsheet in your project folder.
Ahh Brian, thank you! It worked beautifully. Is there any modifications to save it to the desktop? I have lots of working folders depending on which project I am on and it's easy to grab them from my desktop.
David, if you are using version 9 I would suggest you attach it to a ribbon for easy access. I am at work now and don't have access to V9 so I will give more detailed instructions when I get home tonight. Glad it worked.
Hi David, like I said before you should attach this to the ribbon so that you have easy access to it.
I would first copy it to your local libray and then attach it to your ribbon. Here are the steps if they don't make sense let me know and I can probably post a vidoe of how to do it.
The reason I moved the script to the Local Library is if you ever delete or move the project the script will still be available.
Let me know if this makes sense.
Iam using IDEA 3
error on line: 12 - object doesn't support this property or method
Hi seif2468, IDEA 3 doens't exist. Can you post which version of IDEA you are using. Also this error, did you copy the above script into your editor and try running it?