AnsweredAssumed Answered

GetVersionVars, using Excel (VBA) problem

Question asked by Amai Zeg on Oct 4, 2013
Latest reply on Oct 8, 2013 by Amai Zeg

Hello,

 

I'm trying to load variables of datacards in Excel, in order to print them (some kind of history of checks and approvals of a file).

First I was using GetVar, which is working, but is not the most convenient way to load variables of older versions of a file I guess.

 

Now I'm trying with GetVersionVars, see my code below. I'm not sure what to do with 'RetVariables' in order to get the script working.

Compile error: Type mismatch: array or user-defined type expected. I tried to dim 'RetVariables' as array, but Í don't know what the

size must be.

 

Is it also possible to get a certain variable, like 'author', or should I search afterwards for this variable?

 

Also, I'm not sure how to get the folderID.

 

I hope someone can help me with this. I'm not sure if what I want is possible with Excel.

 

Sub main()
   
    Dim objVault As IEdmVault8
    Dim VaultName As String
  
    VaultName = Worksheets("Settings").Range("C2").Text
 
    Set objVault = New EdmVault5
    objVault.LoginAuto VaultName, 0

    Dim FileName As String
    ChDrive objVault.RootFolderPath
    ChDir objVault.RootFolderPath
   
    FileName = Application.GetOpenFilename("All Files (*.*),*.*")

    If FileName = "False" Then
        Exit Sub
    End If
             
    Dim objFile As IEdmFile8
    Dim objFolder As IEdmFolder5
    Set objFile = objVault.GetFileFromPath(FileName, objFolder)
   
    Dim varComponentEnum As IEdmEnumeratorVariable7
    Set varComponentEnum = objFile.GetEnumeratorVariable

 

    Dim Version As Integer
    'Dim FolderID As Integer
    Dim RetVariables As IEdmVariableValue6
    Dim RetConfigs As String
    Dim RetData As EdmGetVarData
   
    Version = 0
 
    Dim FolderID As Long
    FolderID = objFolder.GetCardID(".")

 

   varComponentEnum.GetVersionVars Version, FolderID, RetVariables, RetConfigs, RetData

    

End Sub

Outcomes