Skip to main content

Search for tables

Hello,
I'm automating several IDEA scripts. It turns out that for my analyses, I always import two large tables. I've written a separate script to import those two tables. I scheduled the import in Windows to run early in the morning. The question is: How do I get the other scripts to search for the tables in that folder and load them when they run?
Thanks

Brian Element Sun, 06/29/2025 - 19:03

Here is some code you can add to your scripts that will check if a file exists and if it does then it will carry out the tests.  I am not sure if this is what you are looking for, let me know if it isn't.

Sub Main
    Dim fso As Object
    Dim sFile As String
    
    Set fso = CreateObject("Scripting.FileSystemObject")
    
    sFile = Client.WorkingDirectory() & "General Ledger-GL - Journal Entries.IMD"
    
    If Not fso.FileExists(sFile) Then
        MsgBox "Exit script, file has not been imported"
        Exit Sub
    End If
    
    'File exists so run tests.
    
End Sub

ortizmario6025… Mon, 06/30/2025 - 08:41

The idea is that my main script looks for the table in a directory, which I export with another script. If it's there, then the process begins.
That's the idea.
The important thing is to have those tables in a single directory; the other scripts should point to that directory.

Brian Element Mon, 06/30/2025 - 18:35

Then the code I gave you above should work as it will check for a file located in a specific directory, if it is there then it will start the script.