GithubHelp home page GithubHelp logo

excel's Introduction

About excel ole

win32 excel ole implementation for golang

在Windows系统下调用github.com/mattn/go-ole库操作Excel文件,需要go-ole库的支持

需求

go get github.com/mattn/go-ole
go install github.com/mattn/go-ole
go get github.com/mattn/go-ole/oleutil
go install github.com/mattn/go-ole/oleutil

##安装

go get github.com/nivrrex/excel
go install github.com/nivrrex/excel

例子

package main

import (
	"github.com/nivrrex/excel"
	"strconv"
	"fmt"
)

func main() {
	
	e := &excel.Excel{Visible: false, Readonly: false, Saved: true}
	
	e.New()
	//filePath := "T:\\test.xlsx"
	//e.Open(filePath)
	
	//test error
	fmt.Println (e.Cells(1,1))
	
	e,_ = (e.SheetsCount())
	fmt.Println (e.Count)
	
	e.Sheet(1)
	for i:=1 ; i< 99 ; i++ {
		e.CellsWrite(strconv.Itoa(i),i,1)
	}

	v ,_:= e.Cells(10,1)
	fmt.Println (v)

	//e.Save()
	e.SaveAs("T:\\test.result.xls","xls")
	
	e.Close()
}

更新

  • 2014.6.18 可以直接使用go get/go install进行安装使用,不需要再人工编译了。
  • 2014.6.15 将原有函数调用模式,更新为struct + func 的调用模式,感觉面向对象一点,看起来稍显舒服。
  • 2012.9.07 first commit.

excel's People

Contributors

nivrrex avatar

Watchers

James Cloos avatar

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.