1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
appExcel = CreateObject("Excel.Application")
'Ouverture du fichier type Excel
wbExcel = appExcel.Workbooks.Open("\\Ppffiles\commun\PRODUCTION\POPP\Rapports\F-PRO-09 Rapport injection.xlsx")
'wsExcel correspond à la première feuille du fichier
wsExcel = wbExcel.Worksheets(1)
'on affice pas excel
appExcel.Visible = True
'Je declare la première page du fichier rapport
Dim NativeWorksheet As Microsoft.Office.Interop.Excel.Worksheet = wbExcel.Worksheets("rapport d'injection")
Dim i As Integer, j As Integer
' Dim tb As TabPageControlCollection
Dim ctrl As Control
'For i = 0 To TabControl1.TabPages.Count - 1
For Each ctrl In TabControl1.TabPages
If TypeName(ctrl) = "TextBox" Then
wsExcel.Range(ctrl.Tag).Value = ctrl.Text
End If |
Partager