2008年12月20日 星期六

EXCEL 畫格子

EXCEL 畫格子



$oExcel.Activesheet.Range("A1").Borders.LineStyle = 4
$oExcel.Activesheet.Range("B3:D5").Borders.LineStyle =3
$oExcel.Activesheet.Range("A6:B7").Borders.LineStyle =2
$oExcel.Activesheet.Range("E1:F6").Borders.LineStyle =1

原始碼
#include <ExcelCOM_UDF.au3>

$oExcel = _ExcelBookNew()

$oExcel.Activesheet.Range("A1").Borders.LineStyle = 4
$oExcel.Activesheet.Range("B3:D5").Borders.LineStyle =3
$oExcel.Activesheet.Range("A6:B7").Borders.LineStyle =2
$oExcel.Activesheet.Range("E1:F6").Borders.LineStyle =1
msgbox ("","","A")
; 結束

;直接使用vba
#cs ----------------------------------------------------------------------------

AutoIt Version: 3.2.12.1
Author: myName

Script Function:
Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

$MyObject = ObjCreate("Excel.Application"); Create an Excel Object
If @error Then
MsgBox(0, "Excel Error:", "Error creating Excel object!")
Exit
EndIf
If Not IsObj($MyObject) Then
MsgBox(16, "Excel Error:", "Error creating Excel object!")
Exit
EndIf

$MyObject.Visible = 1
$MyObject.workbooks.add

$MyObject.Sheets("Sheet1").Select

; xlLineStyle Constants
$xlContinuous = 1
$xlDash = -4115
$xlDashDot = 4
$xlDashDotDot = 5
$xlDot = -4118
$xlDouble = -4119
$xlLineStyleNone = -4142
$xlSlantDashDot = 13
Const $xlThick = 1
; XlBordersIndex Constants
$xlDiagonalDown = 5
$xlDiagonalUp = 6
$xlEdgeBottom = 9
$xlEdgeLeft = 7
$xlEdgeRight = 10
$xlEdgeTop = 8
$xlInsideHorizontal = 12
$xlInsideVertical = 11

With $MyObject.Sheets("Sheet1")
.Range("b6:c7").Borders.LineStyle = $xlDouble
.Range("E3:G4").Borders.LineStyle = 1

.range("b2:c4").Borders($xlEdgeBottom).LineStyle = $xlDash
.range("b2:c4").Borders($xlEdgetop).LineStyle = $xlDash
.range("b2:c4").Borders($xlEdgeright).LineStyle = $xlDash
.range("b2:c4").Borders($xlEdgeLeft).LineStyle = $xlDash

endwith

$MyObject = 0
;結束

沒有留言:

RHEL install EPEL

  https://www.linuxtechi.com/install-epel-repo-on-rhel-system/ EPEL dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest...