client.RunThroughVisualScript

9 posts / 0 new
Last post
yinondotan
Offline
Joined: 11/20/2016 - 10:14
client.RunThroughVisualScript

HI Brian
your site is great!
could you please help me with what this property does:
client.RunThroughVisualScript

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

Hi Yinon,

Glad you are enjoying the site.  Just out of curiousity where did you find that command, it is something that I have never used before.  I see that it is a boolean but I have no idea how you would incorporate it into an IDEA script.  How are you trying to use it?

Brian

yinondotan
Offline
Joined: 11/20/2016 - 10:14

Its in the interop.IdeaLib.dll
you can see it when adding a reference to this dll in visual studio
 

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

Yes, that is where I found it but it might be a command that is not accessible to IDEAScript but can only be used with IDEA.  If you go look there are quite a few of those as you can see the different DLLs that are available to IDEA but not all of them are open.

yinondotan
Offline
Joined: 11/20/2016 - 10:14

 Thank you for your answer Brian.
 
 

kumar
Offline
Joined: 04/23/2018 - 07:14

Hi Brain,
Hope you doing good,
I just registered.
since this blog is related to Idea script, I am posting my question here, 
Q - can we convert .ISS files(IDEA macro scripts) into excel macros or VBscripts
 
Regards,
Kumar

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

Hi Kumar and welcome to the site.

Yes you can, I did play with that awhile ago.  This was written using Visual Studio.  You need to access the IDEA Client object.  I know you can access it through Python which is now included in IDEA 10.3 and I have heard of people using C++ to access the IDEA object and run IDEA.  Hope this helps a bit to get you started.


Module Module1

    Sub Main()
        Dim oIDEA As Idea.IdeaClient
        Dim oDB As COMMONIDEACONTROLSLib.IdeaDatabase
        Dim oTable As COMMONIDEACONTROLSLib.ITableDef
        Dim oField As COMDBLib.Field
        Dim count As Integer
        Dim i As Integer
        Dim sFilename As String

        sFilename = InputBox("Please enter a filename in your project:")
        'MsgBox(sFilename)
        oIDEA = New Idea.IdeaClient
        oDB = oIDEA.OpenDatabase(sFilename)
        oTable = oDB.TableDef

        count = oTable.Count
        For i = 1 To count
            oField = oTable.GetFieldAt(i)
            MsgBox(oField.name)
        Next i

        oField = Nothing
        oTable = Nothing
        oDB = Nothing
        oIDEA = Nothing


    End Sub

End Module
DanHoep
Offline
Joined: 09/13/2018 - 05:37

Hi,
if I may add to this, you can also use LateBinding in Excel-VBA to use the IDEAClient and it's Methods. The following example opens an IDEA-Database, exports it into an Excel-Workbook and opens it afterwards:

Option Explicit

Sub test()
    IDEADB_TO_XLSX "C:\DATA\IDEA\SampleFile.IMD", "C:\Data\MyIDEA_COM_Export.xlsx"
    Workbooks.Open "C:\Data\MyIDEA_COM_Export.xlsx"
End Sub

Sub IDEADB_TO_XLSX(IDEAFile As String, ExcelFile As String)
    Dim IDEAClient As Object
    Dim db As Object
    Dim tsk As Object
    Set IDEAClient = CreateObject("IDEA.IDEACLIENT")
    Set db = IDEAClient.OpenDatabase(IDEAFile)
    With db.ExportDatabase
        .IncludeAllFields
        .PerformTask ExcelFile, "Worksheet", "XLSX", 1, db.Count, ""
    End With
    IDEAClient.CloseDatabase IDEAFile
    IDEAClient.Quit
    Set IDEAClient = Nothing
End Sub

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

Very nice, thank-you very much for sharing, I appreciate it.

Brian