type TProcedure=Procedure(xProgress,xmin,xmax:integer;AEnd:boolean); stdcall; TColItem=packed Record ColWidth:integer; ColColor:Cardinal; DataType:integer; Data : Array of byte; //Array[0..128] of Ansichar;// end; TColCells = array of TColItem; TRowCells = array of TColCells; PRowCells=^TRowCells;
Here is the Visual Basic 6.0 code for the Delphi code you provided: ```vb Option Explicit
Public Declare Sub ExportToExcelA Lib "DataToExcel.dll" (ByRef RowDatas As Any, ByVal AFileName As String, ByVal AFormat As Long, ByVal AProgress As Long)
Type TColItem ColWidth As Long ColColor As Long DataType As Long Data() As Byte End Type
Type TColCells Col() As TColItem End Type
Type TRowCells Row() As TColCells End Type
Public Sub ExportToExcel(RowDatas As TRowCells, ByVal AFileName As String, ByVal AFormat As Long, Optional AProgress As Long = 0) Dim RowIndex As Long, ColIndex As Long, CellIndex As Long Dim RowData() As TColCells, ColData() As TColItem
ReDim RowData(UBound(RowDatas.Row))
For RowIndex = 0 To UBound(RowDatas.Row) ReDim ColData(UBound(RowDatas.Row(RowIndex).Col))
For ColIndex = 0 To UBound(RowDatas.Row(RowIndex).Col) With RowDatas.Row(RowIndex).Col(ColIndex) ReDim .Data(UBound(.Data)) ColData(ColIndex) = . ' Copy the data to the new array. End With Next
ReDim RowData(RowIndex).Row(UBound(ColData)) For CellIndex = 0 To UBound(ColData) RowData(RowIndex).Row(CellIndex) = ColData(CellIndex) ' Copy the data to the new array. Next Next
ExportToExcelA VarPtr(RowData(0)), AFileName, AFormat, AProgress ' Call the DLL function. End Sub ``` Please note that I have not tested this code and it may require some modifications to work properly. Let me know if you need any further assistance.