-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathzoho4.html
More file actions
34 lines (29 loc) · 1.17 KB
/
zoho4.html
File metadata and controls
34 lines (29 loc) · 1.17 KB
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
<html>
</head>
<head>
<body>
<script>
Excel.run(function (context) {
var sheet = context.workbook.worksheets.getItem("Sample");
var expensesTable = sheet.tables.add("A1:D1", true /*hasHeaders*/);
expensesTable.name = "Table1";
Table1.getHeaderRowRange().values = [["Date", "Merchant", "Category", "Amount"]];
Table1.rows.add(null /*add rows to the end of the table*/, [
["1/1/2017", "The Phone Company", "Communications", "$120"],
["1/2/2017", "Northwind Electric Cars", "Transportation", "$142"],
["1/5/2017", "Best For You Organics Company", "Groceries", "$27"],
["1/10/2017", "Coho Vineyard", "Restaurant", "$33"],
["1/11/2017", "Bellows College", "Education", "$350"],
["1/15/2017", "Trey Research", "Other", "$135"],
["1/15/2017", "Best For You Organics Company", "Groceries", "$97"]
]);
if (Office.context.requirements.isSetSupported("ExcelApi", 1.2)) {
sheet.getUsedRange().format.autofitColumns();
sheet.getUsedRange().format.autofitRows();
}
sheet.activate();
return context.sync();
}).catch(errorHandlerFunction);
</script>
</body>
</html>