Dim iFile As Long

    cR.ValueKey = "MaxCount"
    If (cR.KeyExists) Then
        cR.ValueType = REG_DWORD
        MaxFileCount = cR.Value
        
        If (MaxFileCount &gt; 0) Then
            cR.ValueKey = "Count"
            cR.ValueType = REG_DWORD
            m_lFileCount = cR.Value
            
            For iFile = 1 To m_lFileCount
                cR.ValueKey = "File" &amp; iFile
                cR.ValueType = REG_SZ
                m_sFiles(iFile) = cR.Value
            Next iFile
          