27-10-17, 08:24 PM
(27-10-17, 07:38 PM)a.ahmed كتب :PHP كود :
Dim MsExcel = CreateObject("Excel.Application")
MsExcel.Workbooks.Add()
Dim xlWorkBook = MsExcel.Workbooks.Open("d:\book1.xlsx")
DGV1.Columns(0).HeaderText = MsExcel.Cells(0 + 1).Value
DGV1.Columns(1).HeaderText = MsExcel.Cells(1 + 1).Value
DGV1.Columns(2).HeaderText = MsExcel.Cells(2 + 1).Value
DGV1.Columns(3).HeaderText = MsExcel.Cells(3 + 1).Value
Dim I As Integer = 0
DGV1.Rows.Clear()
Do
If MsExcel.Cells(I + 2, 1).Value = "" Then Exit Do
DGV1.RowCount = DGV1.RowCount + 1
DGV1.Rows(I).Cells(0).Value = MsExcel.Cells(I + 2, 1).Value
DGV1.Rows(I).Cells(1).Value = MsExcel.Cells(I + 2, 2).Value
DGV1.Rows(I).Cells(2).Value = MsExcel.Cells(I + 2, 3).Value
DGV1.Rows(I).Cells(3).Value = MsExcel.Cells(I + 2, 4).Value
I = I + 1
Loop
xlWorkBook.Close()
MsExcel.Quit()
تسلم يا كبير
صلى الله على نبينا محمد
اخيكم / محمود صالح
قال الزهري رحمه الله
مــا عُـــبـِد الله بشئ أفضل من العلم

