Home > Back-end >  Cbuilder 2010 how to use the range fast reading excel in a large amount of data, thank you
Cbuilder 2010 how to use the range fast reading excel in a large amount of data, thank you

Time:10-11

CodePudding user response:

Sofa,

CodePudding user response:

It is impossible to quickly, OLE speed is generally slow,

CodePudding user response:

Excel range can return an array, is achievable in vs2008,
It is just in cbuilder return data type, do not know how to solve

CodePudding user response:

Your post code to look,

CodePudding user response:

Vb code

Private Sub ReadData ()
Dim Dat (,) As Object
ICol=zSht. UsedRange. Columns. The Count
IRow=zSht. UsedRange. Rows. Count
Dat=zSht. Range (zDat. Get string (2, I) + ":" + zDat. Get string (iCol, I)). The Value
AddData (Dat)
Dat=zSht. Range (zDat. Get string (1, I + 3) + ":" + zDat. Get string (1, iRow)). The Value
AddData (Dat)
Dat=zSht. Range (zDat. Get string (2, I + 3) + ":" + zDat. Get string (iCol iRow)). The Value
AddData (Dat)

End Sub

Public Function get String (ByVal I As an Integer, ByVal j As Integer) As String
Dim As Integer k
K=Int (I - 1)/(26)
If k & lt; 1 Then
Get string=CRH (Asc (" A ") + I - 1)
The Else
Get string=CRH (Asc (" A ") + k - 1) + CRH (Asc (" A ") + I - 26 * k - 1)
End the If
Get string=get string. Trim + Str (j). The Trim
End the Function

C + + builder code

Void clsExcel: : GetRange (String Line)
{
The Variant rData;
rData=https://bbs.csdn.net/topics/_Sheet.OleFunction (" Range ", Line). OlePropertyGet (" Value ");
//_Sheet OleProcedure ()
If (rData IsArray ())
ShowMessage (rData ArrayHighBound ());
The else
ShowMessage (" None ");
}
no
  • Related