Bonjour, je cherche un moyen d'importer un UserForm dans le code.
Merci
Bonjour, je cherche un moyen d'importer un UserForm dans le code.
Merci
Bonjour,
Tu ne spécifies pas si tu veux faire cela en VBA ou manuellement.
Manuellement, clic droit sur le projet puis Importer un fichier
VBA : http://excel.developpez.com/faq/inde...lsThisWorkbook
A adapter
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 Sub ImportUsf() Dim USF As String USF = "C:\Users\user\Desktop\UserForm1.frm" 'Chemin complet du fichier .frm Application.VBE.ActiveVBProject.VBComponents.Import USF End Sub
Merci sa marche super.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 Private Function LoadForm(NomFrm As String, FolderPath As String) As UserForm Dim FullPath As String FullPath = FolderPath & "\" & NomFrm & ".frm" Set LoadForm = Application.VBE.ActiveVBProject.VBComponents.Import(FullPath).Designer End Function
Partager