A
apple058
Unregistered / Unconfirmed
GUEST, unregistred user!
各位高手:
我希望把 Delphi 中的数据 导入到 Excel 中去。导进去后没有表格形式,
我就问别人怎样添加,别人就告诉我用“ 宏 ”,
我就拷贝了下面一段 宏 代码是用来添加表格用的。
Range("A1:F17").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End Sub
我捉摸了半天也没把它翻译到 Delphi 中去,
我只翻译了第一句:ExcelApplication1.Range['A1','F17'].Select;
请问各位高手,以后的代码怎样改写到 Delphi中去能执行,并且生成表格呢?
谢谢!!!
我希望把 Delphi 中的数据 导入到 Excel 中去。导进去后没有表格形式,
我就问别人怎样添加,别人就告诉我用“ 宏 ”,
我就拷贝了下面一段 宏 代码是用来添加表格用的。
Range("A1:F17").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End Sub
我捉摸了半天也没把它翻译到 Delphi 中去,
我只翻译了第一句:ExcelApplication1.Range['A1','F17'].Select;
请问各位高手,以后的代码怎样改写到 Delphi中去能执行,并且生成表格呢?
谢谢!!!