1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| Dim Excel As New ExcelApplication
Dim wb as Workbook
Dim r as Range
Dim ws as WorkSheet
Set wb = Excel.Workbooks.Add
Excel.Visible = True
Set ws = wb.WorkSheets(1)
Set r = ws.Cells(2, 2) // Par exemple.
Dim Pic As String = "E:\Projets informatiques\Icones\RB\Wikipedia.png" // Chemin de l'image.
dim myShape as Shape
Set myShape =ws.Shapes.AddPicture(PicWikipedia,_ // Nom du fichier.
Office.msoFalse, _ // Lien vers le fichier.
Office.msoTrue, _ // Sauvegarde avec le document..
r.Left, _ // Paramètre gauche.
r.Top, _ // Paramètre au-dessus.
-1, _ // Width (-1 = On garde la largeur originale).
-1) // Height (-1 = On garde la hauteur originale).
ws.Shapes(PicNr)
myShape.Name = "PicWikipedia" + Str(PicNr)
//On ajoute le lien à la shape.
ws.Hyperlinks.Add(Excel.ActiveSheet.Shapes(myShape.Name, "https://fr.wikipedia.org/wiki/" + Mot, "Wikipedia", "Mot") |
Partager