Attribute VB_Name = "Module_MainWorkflow"
Option Explicit
Public Sub Analyze_Click()
Dim wsD As Worksheet: Set wsD = [Link](SHEET_DETECT)
Dim wsC As Worksheet: Set wsC = [Link](SHEET_CERT)
Dim filePath As Variant
Dim formatted As String
' Aucun fichier s�lectionn�
If gFileIndex Is Nothing Or [Link] = 0 Then
[Link]("B" & ROW_ERR1).value = "No files to analyze."
[Link]("B" & ROW_ERR2).value = "Please select Word files first."
Exit Sub
End If
' Assurer ent�tes OK
EnsureCertificatesHeader
' D�marre � la premi�re ligne libre
If gStartRow < CERT_FIRST_DATA_ROW Then gStartRow = CERT_FIRST_DATA_ROW
' Boucle fichiers s�lectionn�s
For Each filePath In [Link]
' EXTRACTION & FORMATAGE WORD
formatted = FormatCertificateWord(CStr(filePath))
' V�rification labels
If Not VerifyLabels(formatted) Then
[Link]("B" & ROW_ERR1).value = "Warning: Missing labels in file:"
[Link]("B" & ROW_ERR2).value = CStr(filePath)
' Passe au fichier suivant
Else
' EXTRACTION ? TABLEAU EXCEL
ExtractToExcel formatted
End If
Next filePath
' Message final
MsgBox "Extraction completed successfully." & vbCrLf & _
"Total certificates inserted: " & (gStartRow - CERT_FIRST_DATA_ROW), _
vbInformation, "IECEx Extraction"
End Sub
Option Explicit
Public Sub Reset_All()
Dim wsD As Worksheet: Set wsD = [Link](SHEET_DETECT)
' RESET feuille Detect
ResetDetectSheet
' RESET tableau Certificates sauf en-t�tes
ClearCertificateRows
' R�initialiser lignes de d�part
gStartRow = CERT_FIRST_DATA_ROW
gStartRowFiles = ROW_FILES_START
' Masquer ANALYZE
UI_HideAnalyze
' Nettoyage messages
[Link]("B" & ROW_ERR1 & ":B" & ROW_ERR2).ClearContents
[Link]("B" & ROW_COUNT).ClearContents
MsgBox "Reset completed successfully.", vbInformation, "RESET"
End Sub