Created
November 8, 2019 13:54
-
-
Save emisjerry/89a652158faf8e53f615a7796dbdb399 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 列出Excel.Application能使用的顏色碼 | |
;ComObjError(false) ; Disable COM Object error notification | |
excelApp := ComObjCreate("Excel.Application") | |
workBook := excelApp.Workbooks.Add | |
excelApp.Visible := True | |
workBook.ActiveSheet.Columns("B").ColumnWidth := 5 | |
Loop 100 | |
{ | |
try | |
{ | |
workBook.ActiveSheet.Range("A" . A_INDEX).Value := A_INDEX | |
excelApp.Range("B" . A_INDEX).Interior.ColorIndex := A_INDEX | |
} catch e { | |
;; do nothing | |
} | |
} | |
workBook.SaveAs("c:\temp\colors.xlsx") | |
workBook.Close() | |
Run, c:\temp\colors.xlsx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment