السلام عليكم ورحمة الله وبركاته
كيف يمكن ارسال البيانات من برنامج السي شارب الى الاكسيل
والعكس
وجزاكم الله خيرا
السلام عليكم ورحمة الله وبركاته
كيف يمكن ارسال البيانات من برنامج السي شارب الى الاكسيل
والعكس
وجزاكم الله خيرا
My Learning mode
Using Excel with c#
At First Note that
*Excel Application Contains Excel.Workbook
*Excel. Workbook Contains Excel.WorkSheet
*Take care that Excel is one based
Step 1:
Preparing Application to deal with Excel
-Add reference
-Com
-Add Microsoft Excel 9.0
-use the library
Ü This will allow you to work with Excel
Step 2:
-make an object from
Microsoft.Office.Interop.Excel.Application
Example:
Microsoft.Office.Interop.Excel.Application ExcelApp
=new Microsoft.Office.Interop.Excel.Application ();
Ü-This will run Excel without opening the book after you set ExclApp//object
ExcelApp.Visible=false;
Step 3:-
-object missing = System.Reflection.Missing.Value;
// Empty object because i dont want to send anything
-Microsoft.Office.Interop.Excel.Workbook;
-objBook=MyExcelApplication.Workbooks.Add
(missing);
Ü the result of step three is to open Empty Excel book
Step 4
-Microsoft.Office.Interop.Excel.Worksheet objSheet = (Microsoft.Office.Interop.Excel.Worksheet)objBook.Sheets["Sheet1"];
-objSheet.Name = "It's Me"; ----- *
-objSheet.Cells[1, 1] = "MHM";
Ü at this step I change sheet tab name -----*
Then write in first cell
So as I see throw this tutorial you can Deal with Excel
Good Luck
Prepared by
Eng.helmy
السلام عليكم
قبل الشروع في تلك المراحل قم بتحميلOffice XP PIAs حيث تجد المكتبة الرئيسية Microsoft.Office.Interop.Excel.dll
Good luck
Ben_Laiid
u can use ADO.NET to communicate directly with EXCEL without any referencing using OLEDB
آسف على اللغة و الاستعجال فى الرد و لكن كيف لا تكون OLEDB فى ADO.NET كافية بمفردها
تم تعديل هذه المشاركة بواسطة ASDen في 14 أغسطس 2007 في 19:02
وعليكم السلام ورحمة الله وبركاته.
ربما ينفعك ماهو موجود في الموضوع التالي :
هذا الموضوع مغلق.
المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية
جارٍ التحقق من المتواجدين…