Bonjour,
Je pilote la construction d'une feuille XL en VB.net grace à la librairie d'Interop.
ça se passe bien jusqu'à ce que j'essaie de redimensionner un commentaire : VS2008 me donne ce message :
"Le membre public 'Shaperange' du type 'Range' est introuvable."
Voici le bout de code concerné :
L'erreur apparait sur l'instruction Shaperange.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 Dim xlApp As New Microsoft.Office.Interop.Excel.Application Dim xlBook As Workbook Dim xlSheet As Worksheet ... xlsheet.Range("A" & ligne).Select() XlApp.Selection.FormulaR1C1 = tab_palier(j, 2) & " (" & tab_palier(j, 0) & ")" XlApp.Selection.Font.Bold = True XlApp.Selection.AddComment() XlApp.Selection.Comment.Visible = False XlApp.Selection.Comment.Text(Text:="Commentaire du :" & tab_palier(j, 26) & Chr(10) & tab_palier(j, 25)) XlApp.Selection.Shaperange.ScaleWidth(4.0, 0, 0) XlApp.Selection.Shaperange.ScaleHeight(1, 5, 0, 0)
Il y a visiblement une chose que je n'ai pas comprise dans le pilotage d'XL.
Quelqu'un a une idée ?
Partager