-
Notifications
You must be signed in to change notification settings - Fork 4
/
tab_colors.bas
35 lines (25 loc) · 1.11 KB
/
tab_colors.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/'
* Example of how to set Excel worksheet tab colors using libxlsxwriter.
*
* Copyright 2014-2017, John McNamara, [email protected]
*
* translated by Lee June by using https://github.com/retsyo/libxlsxwriter_freebasic
'/
#include "auto_xlsxwriter.bi"
function main() as Integer
Dim as lxw_workbook ptr workbook = workbook_new("tab_colors.xlsx")
/' Set up some worksheets. '/
Dim As lxw_worksheet ptr worksheet1 = workbook_add_worksheet(workbook, NULL)
Dim As lxw_worksheet ptr worksheet2 = workbook_add_worksheet(workbook, NULL)
Dim As lxw_worksheet ptr worksheet3 = workbook_add_worksheet(workbook, NULL)
Dim As lxw_worksheet ptr worksheet4 = workbook_add_worksheet(workbook, NULL)
/' Set the tab colors. '/
worksheet_set_tab_color(worksheet1, LXW_COLOR_RED)
worksheet_set_tab_color(worksheet2, LXW_COLOR_GREEN)
worksheet_set_tab_color(worksheet3, &HFF9900) /' Orange. '/
/' worksheet4 will have the default color. '/
worksheet_write_string(worksheet4, 0, 0, "Hello", NULL)
workbook_close(workbook)
return 0
End Function
main()