realbasic to excel/realbasic vers excel 
Author Message
 realbasic to excel/realbasic vers excel

i want to export a listbox to excel  can help me please
je veux exporter une listbox vers un tableau excel ou un modele deja defini
quelqu'un peux m'aider


Mon, 18 Jul 2005 04:56:52 GMT  
 realbasic to excel/realbasic vers excel
This code exports a ListBox's contents to a comma-delimited file:

  Dim x, y As Integer
  Dim Line As String
  Dim t As TextOutputStream
  Dim f As Folderitem

  f = GetSaveFolderItem("text/plain", "mylist.txt")

  If f <> nil Then
    t = f.CreateTextFile
    For x = 0 to ListBox1.ListCount - 1
      For y = 0 to ListBox1.ColumnCount
        Line = Line + ListBox1.Cell(x, y) + ","
      t.WriteLine Line
  End If

You can then import that to Excel.  You also might want to look into the
Office Automation Plugin which could possibly automate the import.

To get an excel sheet into a listbox, you need to do it in reverse order..
Export the excel file as a comma-delimited file, and run a couple of loops
(as above) that read each line and populate the list.

Remember:  any formatting in the source list / sheet will be lost because
you are only transferring the raw-data.


Charlie Boisseau

Mon, 18 Jul 2005 05:09:00 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Realbasic instead of VB in Excel function macro?

2. Sound in RealBasic 4 Prof. (er, RealBasic)

3. Matching Data Types between RealBasic and the RealBasic Database

4. how to create an excel workbook using the excel toolkit

5. Excel toolkit --excel is broken arrow

6. after opening an excel doc with actve X, crashes when calling excel again

7. Using Win32OLE with Excel leaves Excel process hanging

8. Calling DVF dll from Excel: Excel macro problem?

9. Looking for Excel API library (XLCALL.LIB) for Excel 7

10. convert txt excel file without open the excel application

11. ip vers nom et nom vers ip

12. Looping over a directory and reading Jpegs into a database -- Realbasic 4.5


Powered by phpBB® Forum Software