Code Monkey home page Code Monkey logo

excel's Introduction

excel 基于go-ole

可以操作xls文件,必须先安装Microsoft office excel,2010以前的版本最多只能操作65535行。

为了便于操作,任何函数不会因抛出错误而退出程序,但是任何错误的操作都可能返回nil。

如:Excel.NewWorkBook(),是返回workbook对象,错误时会返回的workbook将会是nil

安装

go get -u -v github.com/jinzhongmin/excel

例子

package main

import (
	"github.com/jinzhongmin/excel"
)

func main() {
	Excel := excel.NewExcel()
	Const := excel.NewConst()
	Excel.Visible(true)

	workbook := Excel.NewWorkBook()
	sheet1 := workbook.Sheet(0)
	sheet1.Cell(1, 1).SetValue("Hello excel")
	sheet1.Cell(1, 1).GetFont().SetColor("FF00FF")
	byName := workbook.Sheet(sheet1.GetName())
	byName.Cell(1, 2).SetValue("get sheet by name")

	workbook.SaveAs("excel.xlsx", Const.FILEFORMATxlWorkbookDefault)

	Excel.Close()
}

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.