Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Goxcel is a library to operate MS Excel using go-ole library.

License

NotificationsYou must be signed in to change notification settings

devlights/goxcel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

197 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Goxcel is a library to operate Excel usinggo-ole package. Thanksgo-ole package!

This library works only on Windows.

CodeFactorGoxcel - Go VersionPkgGoDev

Install

go get github.com/devlights/goxcel@latest

Usage

Import statement

package mainimport ("github.com/devlights/goxcel")funcinit() {log.SetFlags(0)}// main is entry point of this app.funcmain() {ret,xlsx:=run()ifret==0 {// Launch EXCEL_=exec.Command("cmd","/C",xlsx).Run()}os.Exit(ret)}funcrun() (int,string) {// 0. Initialize Goxcelquit:=goxcel.MustInitGoxcel()deferquit()// 1. Create new Goxcel instance.excel,release:=goxcel.MustNewGoxcel()// must call goxcel release function when function exited// otherwise excel process was remained.deferrelease()// optional settingsvisible:=falseexcel.MustSilent(visible)// 2. Get Workbooks instance.wbs:=excel.MustWorkbooks()// 3. Add Workbookwb,wbRelease:=wbs.MustAdd()// call workbook's release functiondeferwbRelease()// 4. Get Worksheetws:=wb.MustSheets(1)// 5. Get Cellc:=ws.MustCells(1,1)// 6. Set the value to cellc.MustSetValue("こんにちはWorld")p:=filepath.Join(os.TempDir(),"helloworld.xlsx")log.Printf("SAVE FILE: %s\n",p)// 7. Savewb.MustSaveAs(p)// Workbook::SetSaved(true) and Workbook::Close() is automatically called when `defer wbReleaseFn()`.// Excel::Quit() and Excel::Release() is automatically called when `defer release()`.return0,p}

Also look at the "examples" directory :)

About

Goxcel is a library to operate MS Excel using go-ole library.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2026 Movatter.jp