Re: Vba & XP Sp2
Salut,
"MSCOMCT2.OCX" est un contrôle VB et non VBA, donc pour le trouver il faut Visual Basic soit installé sur la machine.
Sinon il faut copier le fichier dans windows\system32 (WIn NT, 2000, XP) ou windows\system (Win98, Me).
IL faut l'enregistrer dans la Base de registre WIndows. Démarrer /éxécuter/ taper à l'invite:
regserv32 c:\windows\system32\MSCOMCT2.OCX.
Pour le faire en VBA,
sub Princ()
regocx "C:\lepertoireoùestsituélecontrole\","msconct2.ocx"
end sub
Sub RegOcx(Chemin$, Optional NomOcx$)
Dim CheSyS$
If Dir(Chemin) = "" Then Exit Sub
CheSyS = RepertoireSyS
If Dir(CheSyS & NomOcx) = "" Then FileCopy Chemin, CheSyS & NomOcx
Shell CheSyS & "regsvr32.exe " & NomOcx & " /s", 0
End Sub
Function RepertoireSyS$()
With CreateObject("Scripting.FileSystemObject")
RepertoireSyS = .GetSpecialFolder(1) & "\"
End With
End Function
A+++