BESOIN D'AIDE ... !!! Insersion fichier dans une cellule specefic avec bouton valider

slimenslouma

New Member
Joined
Apr 1, 2018
Messages
4
Bonjour tout le monde , je suis dans la ***** et j'ai besoin de l'aide vraiment , je prépare un sujet PFE et je dois avoir un outils de suivi et tracabilité , bref , je cherche comment inserer un fichier depuis mon ordinateur dans la cellule approprié au formulaire ajout avec le bouton ajout ,
j'ai utilisé cette procédure
Private Sub importer_Click()




'Get file path
fpath = Application.GetOpenFilename("All Files,*.*", Title:="Select file")
If LCase(fpath) = False Then Exit Sub

'Insert file

ActiveSheet.OLEObjects.Add _
Filename:=fpath, _
Link:=False, _
DisplayAsIcon:=True, _
IconFileName:="excel,pdf,word.exe", _
IconIndex:=0, _
IconLabel:=extractFileName(fpath)


End Sub


Public Function extractFileName(filePath)
Dim i As Integer
Dim e As Integer
i = 5

Cells(2, i).Select

If Cells(2, i) = "" Then i = i + 1




End Function



et pour le formulaire ajout cette procedure qui marche parfaitement


'****************************
'procedure permettant le rajout d'une nouvelle personne
' à la fin de base de données
'*******************************
Private Sub btnvalider_Click()
' Declaration variable
Dim i As Integer
' Affectation variable
i = 1
' on boucle chacune des cellules de la colonne B ( Nom )
Do While Cells(i, 1) <> ""
Cells(i, 1).Offset(1, 0).Select
i = i + 1 'on incrémente le compteur de la boucle while



Loop


' affichage dans la base de donnée des infos provenant du formulaire
ActiveCell.Value = Me.txtmatricule
ActiveCell.Offset(0, 1) = Me.txtNom.Value
ActiveCell.Offset(0, 2) = Me.txtPrenom.Value
ActiveCell.Offset(0, 3) = Me.txtAge.Value


Unload Me






End Sub


vraiment j'ai besoin d'aide ....
 
Last edited by a moderator:

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Traduit par Google:
Bienvenue à MrExcel
Nous avons un forum spécial pour les questions non en anglais, donc je l'ai déplacé là.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,510
Messages
6,114,040
Members
448,543
Latest member
MartinLarkin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top