[Résolu][VB.net] controler Excel dans une Form ?
Bonjour,
Je suis en VB.Net Express 2005.
Je voudrais ouvrir un classeur Excel, l'afficher dans un Panel de ma Form et avoir accès à toutes les fonctionnalités de Excel.
D'un côté, je sais lancer une appli Excel en VB.Net :
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
Dim WithEvents AppExcel As Excel.Application
Dim WithEvents Classeur As Excel.Workbook
Dim Feuille As Excel.Worksheet
Friend WithEvents Panel1 As System.Windows.Forms.Panel
Dim WithEvents win As Excel.Window
AppExcel = New Excel.Application
Classeur = AppExcel.Workbooks.Open("D:\essvb.xls")
Feuille = Classeur.ActiveSheet
win = AppExcel.Windows(1)
... |
De l'autre, je sais lancer excel dans un Panel :
Code:
1 2 3 4 5
|
Dim pinfo As New ProcessStartInfo("D:\essvb.xls")
Dim p As Process = System.Diagnostics.Process.Start(pinfo)
p.WaitForInputIdle()
SetParent(p.MainWindowHandle, Me.Panel1.Handle) |
Mais là je ne vois qu'un process. Je ne sais pas accéder aux feuilles, cellules, etc d'Excel . .
En résumé, je voudrais mettre mon AppExcel dans le Panel par SetParent.
Quelqu'un saurait comment faire ?
Merci!
Sergio