24-03-13, 01:09 PM
(آخر تعديل لهذه المشاركة : 24-03-13, 06:55 PM {2} بواسطة طاهر الشيخي.)
انا افتح الاكسيل من برنامجي ولكن الكود ياخذ وقت لفتح البرنامج اريد ان يكون عملية الانتظار حتي الفتح بشريط البروجريس بار
واريد وضع زر للالغاء البرجريس بار وانهاء االعملية
يعني ربط فتح الملف الاكسيل بالبروجريس بار للفتح علما بان الاكواد
ارجوا التعديل علي بمثال
Dim xlApp As Excel.Application
Dim xlWorkBook As Excel.Workbook
Dim xlWorkSheet As Excel.Worksheet
Dim misValue As Object = System.Reflection.Missing.Value
xlApp = New Excel.ApplicationClass
xlWorkBook = xlApp.Workbooks.Add(misValue)
xlWorkSheet = xlWorkBook.Sheets("sheet1")
xlApp.Visible = True
'add data
xlWorkSheet.Cells(1, 1) = ""
xlWorkSheet.Cells(1, 2) = "Issac"
xlWorkSheet.Cells(1, 3) = "Raja"
xlWorkSheet.Cells(1, 4) = "Ravi"
xlWorkSheet.Cells(2, 1) = "Term1"
xlWorkSheet.Cells(2, 2) = "80"
xlWorkSheet.Cells(2, 3) = "65"
xlWorkSheet.Cells(2, 4) = "45"
xlWorkSheet.Cells(3, 1) = "Term2"
xlWorkSheet.Cells(3, 2) = "78"
xlWorkSheet.Cells(3, 3) = "72"
xlWorkSheet.Cells(3, 4) = "60"
xlWorkSheet.Cells(4, 1) = "Term3"
xlWorkSheet.Cells(4, 2) = "82"
xlWorkSheet.Cells(4, 3) = "80"
xlWorkSheet.Cells(4, 4) = "65"
xlWorkSheet.Cells(5, 1) = "Term4"
xlWorkSheet.Cells(5, 2) = "75"
xlWorkSheet.Cells(5, 3) = "82"
xlWorkSheet.Cells(5, 4) = "68"
'create chart
Dim chartPage As Excel.Chart
Dim xlCharts As Excel.ChartObjects
Dim myChart As Excel.ChartObject
Dim chartRange As Excel.Range
xlCharts = xlWorkSheet.ChartObjects
myChart = xlCharts.Add(10, 80, 300, 250)
chartPage = myChart.Chart
chartRange = xlWorkSheet.Range("A1", "d5")
chartPage.SetSourceData(Source:=chartRange)
chartPage.ChartType = Excel.XlChartType.xl3DColumnStacked
'exporting chart as picture file
واريد وضع زر للالغاء البرجريس بار وانهاء االعملية
يعني ربط فتح الملف الاكسيل بالبروجريس بار للفتح علما بان الاكواد
ارجوا التعديل علي بمثال
Dim xlApp As Excel.Application
Dim xlWorkBook As Excel.Workbook
Dim xlWorkSheet As Excel.Worksheet
Dim misValue As Object = System.Reflection.Missing.Value
xlApp = New Excel.ApplicationClass
xlWorkBook = xlApp.Workbooks.Add(misValue)
xlWorkSheet = xlWorkBook.Sheets("sheet1")
xlApp.Visible = True
'add data
xlWorkSheet.Cells(1, 1) = ""
xlWorkSheet.Cells(1, 2) = "Issac"
xlWorkSheet.Cells(1, 3) = "Raja"
xlWorkSheet.Cells(1, 4) = "Ravi"
xlWorkSheet.Cells(2, 1) = "Term1"
xlWorkSheet.Cells(2, 2) = "80"
xlWorkSheet.Cells(2, 3) = "65"
xlWorkSheet.Cells(2, 4) = "45"
xlWorkSheet.Cells(3, 1) = "Term2"
xlWorkSheet.Cells(3, 2) = "78"
xlWorkSheet.Cells(3, 3) = "72"
xlWorkSheet.Cells(3, 4) = "60"
xlWorkSheet.Cells(4, 1) = "Term3"
xlWorkSheet.Cells(4, 2) = "82"
xlWorkSheet.Cells(4, 3) = "80"
xlWorkSheet.Cells(4, 4) = "65"
xlWorkSheet.Cells(5, 1) = "Term4"
xlWorkSheet.Cells(5, 2) = "75"
xlWorkSheet.Cells(5, 3) = "82"
xlWorkSheet.Cells(5, 4) = "68"
'create chart
Dim chartPage As Excel.Chart
Dim xlCharts As Excel.ChartObjects
Dim myChart As Excel.ChartObject
Dim chartRange As Excel.Range
xlCharts = xlWorkSheet.ChartObjects
myChart = xlCharts.Add(10, 80, 300, 250)
chartPage = myChart.Chart
chartRange = xlWorkSheet.Range("A1", "d5")
chartPage.SetSourceData(Source:=chartRange)
chartPage.ChartType = Excel.XlChartType.xl3DColumnStacked
'exporting chart as picture file