locked
want to save data in mobile excel sheet.... RRS feed

  • Question

  • Hello,

    I have opticon H19B device which is having windows mobile professional 6 installed.

    I am working on barcode scanning.it works fine.I have one button on form and listbox.When I scan barcode it adds to listbox.

    it is working very fine, But When i click on button the data which are in listbox must be saved in excel. mobile office already intalled in Device.

    I tried with text file.It saves in text file nicely.

    code are below.

    which works for text file

     

    Dim sw As IO.TextWriter

    sw = File.AppendText(

    "sr.xlsx")

     

    Try

     

    If ListSrNo.Items.Count > 0 Then

     

    If ListSrNo.Items.Count = ListTagNo.Items.Count Then

     

    For i As Integer = 0 To ListSrNo.Items.Count - 1

     

    Dim firsval As String = ListSrNo.Items(i)

     

    Dim secondval As String = ListTagNo.Items(i)

    sw.WriteLine(firsval &

    " " & secondval)

     

    Next

    MessageBox.Show(

    "Saved Successfully")

    ListSrNo.Items.Clear()

    ListTagNo.Items.Clear()

     

    End If

     

    End If

     

    Catch ex As Exception

    MessageBox.Show(ex.Message.ToString())

     

    Finally

    sw.Flush()

    sw.Close()

     

    End Try

    please help me

    I want to save data in sheet1 and in B cloumn

    Regards,

    ASIF

    Sunday, August 1, 2010 9:16 AM

Answers

  • Excel file is not a text file, you can not just append lines to it. On desktop Excel exposes object model to manipulate Excel files but there's no such thing on device. That means it's pretty much impossible unless you can find 3rd party library which understands Excel file format.

    As alternative consider using CSV files instead. These files are simple text file with column data separated by commas (that's what CSV means - Comma Separated Values). These you can append to and Excel can load these.



    This posting is provided "AS IS" with no warranties, and confers no rights.
    Sunday, August 1, 2010 5:04 PM