ReoGrid Forum

Fast and powerful .NET Spreadsheet Component

You are not logged in.


This forum has been archived and no longer accepts new user registrations. Please report your questions, problems, and feedback to the issue page of ReoGrid on GitHub. Thank you for your cooperation.

#1 2017-05-12 18:01:54

Registered: 2015-06-09
Posts: 10

Mistake when read a memory book

Hello Jing,

I am reading a memory work book but I have some problems with the import data from cells with formulas. Instead of give me the correct result, the program give me other data.
I had the same error other times and I don't know why, always with the cells with formulas, never with cells with numbers.
The code is very simple and I think it is free of mistake so I suppose the problem is with the dll I am using:  0.9.3 version.

I would like to send you the complete example including the excel file with the formulas but I don't know where or maybe you have already discovered this problem and it is fixed in the new version.

Thank you,

P.D. This is the code of the module:

Imports unvell.ReoGrid

Public Class Form1

    Dim WorkbookModel As IWorkbook = ReoGridControl.CreateMemoryWorkbook

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
        'Creacción de un Workbook en la memoria para contener el modelo estructural 

    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim lsheet As Worksheet
        Dim lrow, lcol As Integer
        Dim ldata1(4) As Object

        With OpenFileDialog1
            .InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyDocuments
            .Filter = "Ficheros de excel|*.xlsx;*.xlsm|" &
                      "Todos los ficheros (*.*)|*.*"
            .DefaultExt = "xlsx"
            .FileName = "Data01.xlsx"
            .InitialDirectory = "C:\Users\Antonio\Documents\VBNET_PRUEBAS\ExcelReadMistake"
        End With

        If OpenFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
                WorkbookModel.Load(OpenFileDialog1.FileName, IO.FileFormat.Excel2007)
                MsgBox("Impossible open file", 16)
            End Try
        End If

        lsheet = WorkbookModel.Worksheets(0)
        lrow = 2
        lcol = 14

        For i = 0 To 4
            ldata1(i) = lsheet(lrow, lcol)
            lrow += 1
        Next i

        Me.TextBox1.Text = ldata1(0)
        Me.TextBox2.Text = ldata1(1)
        Me.TextBox3.Text = ldata1(2)
        Me.TextBox4.Text = ldata1(3)
        Me.TextBox5.Text = ldata1(4)

    End Sub

End Class


Board footer

Powered by FluxBB