21-03-18, 12:28 AM
PHP كود :
'Dim ofd As New OpenFileDialog
'ofd.Filter = "Excel|*.xls;*.xlsx"
'If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then
' Me.Cursor = Cursors.WaitCursor 'تغير المؤشر للانتظار
' Dim MsExcel = CreateObject("Excel.Application")
' Dim xlWorkBook = MsExcel.Workbooks.Open(ofd.FileName)
' DGV1.DataSource = Nothing
' For I As Integer = 0 To MsExcel.Rows.Count - 2
' If MsExcel.Cells(I + 2, 1).Value.ToString = "" Then Exit For
' DGV1.Rows.Add()
' Dim value1 As String = MsExcel.Cells(I + 2, 1).Value.ToString.Trim
' Dim value2 As String = MsExcel.Cells(I + 2, 2).Value.ToString.Trim
' Dim value3 As Integer = MsExcel.Cells(I + 2, 3).Value
' Dim value4 As Integer = MsExcel.Cells(I + 2, 4).Value
' Dim value5 As Integer = MsExcel.Cells(I + 2, 5).Value
' DGV1.Rows(I).Cells(0).Value = value1
' DGV1.Rows(I).Cells(1).Value = value2
' DGV1.Rows(I).Cells(2).Value = value3
' DGV1.Rows(I).Cells(3).Value = value4
' DGV1.Rows(I).Cells(4).Value = value5
' DGV1.Rows(I).Cells(5).Value = MsExcel.Cells(I + 2, 6).Value
' Next
' xlWorkBook.Close()
' MsExcel.Quit()
' Me.Cursor = Cursors.Default 'تغير المؤشر للاصل
'End If
صلى الله على نبينا محمد
اخيكم / محمود صالح
قال الزهري رحمه الله
مــا عُـــبـِد الله بشئ أفضل من العلم

