the code tries to export the table memberinfo to excel.
I went and copied this code a couple of hours ago or so, then I got interrupted by a loooong phone call. Anyway, I can't resolve some definitions and I also forgot what I was thinking... Can you post an example with complete code that will compile?
Microsoft.Office.Interop.Excel.Application exc = new Microsoft.Office.Interop.Excel.Application(); exc.Visible = true; _Workbook workbook; _Worksheet worksheet; Workbooks workbooks = exc.Workbooks; workbook = workbooks.Add(true); Sheets sheets = workbook.Worksheets; worksheet = (_Worksheet)sheets.get_Item(1); // start inserting your values here. Range range1 = worksheet.get_Range("A1", "A1"); string array1 = new string; array1 = "Some text"; Object args1 = new Object; args1 = array1; range1.GetType().InvokeMember("Value", System.Reflection.BindingFlags.SetProperty, null, range1, args1); // You can modify this above section of code accordingly and put it in a for/foreach loop to insert values at different locations.
Make sure to include the Microsoft Excel 12 Libraries before you do this.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.