[ BackoSoft @ 25.02.2012. 19:47 ] @
[ BackoSoft @ 25.02.2012. 19:47 ] @
[ aca andrijevic @ 26.02.2012. 10:30 ] @
Uzmes napravis for petlju za 5 linija informacija iz RTBoxa i stavis linije u neki array.Iz tog array posle
izvuces elemente koji ti trebaju i stavis ih u celije u excel-u. [ mish_ns @ 27.02.2012. 06:34 ] @
Prvo bi morao da dodaš referencu na Microsoft Excel 12.0 Object library.
Sa Add Reference... odeš na COM odeljak. U kodu dodaš: Imports Excel = Microsoft.Office.Interop.Excel Primer koda bi bio ovakav: Code: Dim oldCI As System.Globalization.CultureInfo = _ System.Threading.Thread.CurrentThread.CurrentCulture System.Threading.Thread.CurrentThread.CurrentCulture = _ New System.Globalization.CultureInfo("en-US") excelApp = CreateObject("Excel.Application") excelWorkBook = xlApp.Workbooks.Add() excelWorkSheet = xlWorkBook.Sheets("sheet1") excelWorkSheet.Cells(1, 1) = "Ime:" excelWorkSheet.Cells(1, 2) = "Milan" excelWorkSheet.Cells(1, 3) = "Prezime:" excelWorkSheet.Cells(1, 4) = "Milanović" excelWorkBook.SaveAs("C:\Imenik.xls") excelApp.Quit() excelWorkBook = Nothing excelApp = Nothing System.Threading.Thread.CurrentThread.CurrentCulture = oldCI E sad ako ti reba svaki 5 put onda prvo čitaš iz richtextboxa podatke, smeštaš u neki niz. i onda: Code: ... for index as integer = 0 to 4 excelWorkSheet.Cells(index, 1) = nizImena(i) excelWorkSheet.Cells(index, 2) = nizPrezimena(i) excelWorkSheet.Cells(index, 3) = nizTelefona(i) excelWorkSheet.Cells(index, 4) = nizAdresa(i) next ... Copyright (C) 2001-2025 by www.elitesecurity.org. All rights reserved.
|