[已解决]excel不能向下填充,请大侠们修改一下代码,谢谢!
本帖最后由 pchome2000 于 2018-3-29 21:01 编辑excel不能向下填充,请大侠们修改一下代码,谢谢!
#include <Array.au3>
#include <Excel.au3>
#include <MsgBoxConstants.au3>
; Create application object and create a new workbook
Local $oExcel = _Excel_Open()
If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeWrite Example", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
Local $oWorkbook = _Excel_BookNew($oExcel)
If @error Then
MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeWrite Example", "Error creating the new workbook." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
_Excel_Close($oExcel)
Exit
EndIf
; *****************************************************************************
; Write a string with a line break to the active sheet in the active workbook
; *****************************************************************************
_Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, "123")
$oWorkbook.ActiveSheet.AutoFill.Destination.Range("a1:a13")) 最后一句修改为 $oWorkbook.ActiveSheet.range("a1").AutoFill($oWorkbook.ActiveSheet.Range("a1:a13")) 另如果只是想把a1:a13写成一样的123,下面也可以
$oWorkbook.ActiveSheet.Range("a1:a13").value="123" 非常感谢,,,,,可以使用了。。。。。。 回复 4# pchome2000
不客气,共同学习
页:
[1]