goxcel

package module
v0.6.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 9 Imported by: 2

README

Goxcel

Goxcel is a library to operate Excel using go-ole package. Thanks go-ole package!

This library works only on Windows.

CodeFactor Goxcel - Go Version PkgGoDev

Install

go get github.com/devlights/goxcel@latest

Usage

Import statement
package main

import (
    "github.com/devlights/goxcel"
)

func init() {
	log.SetFlags(0)
}

// main is entry point of this app.
func main() {
	ret, xlsx := run()
	if ret == 0 {
		// Launch EXCEL
		_ = exec.Command("cmd", "/C", xlsx).Run()
	}

	os.Exit(ret)
}

func run() (int, string) {
	// 0. Initialize Goxcel
	quit := goxcel.MustInitGoxcel()
	defer quit()

	// 1. Create new Goxcel instance.
	excel, release := goxcel.MustNewGoxcel()

	// must call goxcel release function when function exited
	// otherwise excel process was remained.
	defer release()

	// optional settings
	visible := false
	excel.MustSilent(visible)

	// 2. Get Workbooks instance.
	wbs := excel.MustWorkbooks()

	// 3. Add Workbook
	wb, wbRelease := wbs.MustAdd()

	// call workbook's release function
	defer wbRelease()

	// 4. Get Worksheet
	ws := wb.MustSheets(1)

	// 5. Get Cell
	c := ws.MustCells(1, 1)

	// 6. Set the value to cell
	c.MustSetValue("こんにちはWorld")

	p := filepath.Join(os.TempDir(), "helloworld.xlsx")
	log.Printf("SAVE FILE: %s\n", p)

	// 7. Save
	wb.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()`.

	return 0, p
}

Also look at the "examples" directory :)

Documentation

Overview

Package goxcel is a library to operate Excel made in Golang. This library works only on Windows.

Goxcel is the main struct in this library. NewGoxcel() is the staring point.

References:

Index

Constants

This section is empty.

Variables

View Source
var (
	ValueMustBeGreaterThanZero = errors.New("value must be greater than 0")
	ValueCantConvertToInt      = errors.New("value can't convert to int type")
	ValueCantConvertToString   = errors.New("value can't convert to string type")
	ValueCantConvertToBool     = errors.New("value can't convert to bool type")
)
View Source
var (
	SkipRow = errors.New("skip row")
	SkipCol = errors.New("skip col")
)

Functions

func InitGoxcel added in v0.5.4

func InitGoxcel() (func(), error)

func MustInitGoxcel added in v0.5.15

func MustInitGoxcel() func()

func MustNewGoxcel added in v0.5.15

func MustNewGoxcel() (*Goxcel, ReleaseFunc)

func NewGoxcel

func NewGoxcel() (*Goxcel, ReleaseFunc, error)

func NewWorkbook

func NewWorkbook(wbs *Workbooks, wb *ole.IDispatch) (*Workbook, ReleaseFunc)

Types

type Cell

type Cell struct {
	// contains filtered or unexported fields
}

func NewCell

func NewCell(ws *Worksheet, c *ole.IDispatch) *Cell

func NewCellFromRange added in v0.4.0

func NewCellFromRange(ra *XlRange, c *ole.IDispatch) *Cell

func (*Cell) Column added in v0.6.0

func (c *Cell) Column() (int32, error)

func (*Cell) ComObject

func (c *Cell) ComObject() *ole.IDispatch

func (*Cell) End added in v0.6.0

func (c *Cell) End(direction constants.XlDirection) (*XlRange, error)

func (*Cell) Font added in v0.4.0

func (c *Cell) Font() (*Font, error)

func (*Cell) Goxcel added in v0.1.2

func (c *Cell) Goxcel() *Goxcel

func (*Cell) Interior added in v0.4.0

func (c *Cell) Interior() (*Interior, error)

func (*Cell) MustSetValue added in v0.5.16

func (c *Cell) MustSetValue(value interface{})

func (*Cell) MustValue added in v0.5.15

func (c *Cell) MustValue() interface{}

func (*Cell) PageBreak added in v0.6.4

func (c *Cell) PageBreak(pageBreakType constants.XlPageBreak) error

func (*Cell) Releaser added in v0.1.3

func (c *Cell) Releaser() *Releaser

func (*Cell) Row added in v0.6.0

func (c *Cell) Row() (int32, error)

func (*Cell) Select added in v0.1.4

func (c *Cell) Select() error

func (*Cell) SetNumberFormatLocal added in v0.5.2

func (c *Cell) SetNumberFormatLocal(format constants.NumberFormatLocal) error

func (*Cell) SetValue

func (c *Cell) SetValue(value interface{}) error

func (*Cell) String added in v0.2.1

func (c *Cell) String() (string, error)

func (*Cell) Value

func (c *Cell) Value() (interface{}, error)

type ComReleaser added in v0.4.0

type ComReleaser interface {
	HasReleaser
	HasComObject
}

noinspection GoNameStartsWithPackageName

type Font added in v0.4.0

type Font struct {
	// contains filtered or unexported fields
}

Font represents an Excel Font

REFERENCES::

func NewFont added in v0.4.0

func NewFont(c *Cell, comObj *ole.IDispatch) *Font

func NewFontFromRange added in v0.4.0

func NewFontFromRange(r *XlRange, comObj *ole.IDispatch) *Font

func (*Font) Bold added in v0.4.0

func (f *Font) Bold() (bool, error)

func (*Font) Color added in v0.4.0

func (f *Font) Color() (constants.XlRgbColor, error)

func (*Font) ComObject added in v0.4.0

func (f *Font) ComObject() *ole.IDispatch

func (*Font) Goxcel added in v0.4.0

func (f *Font) Goxcel() *Goxcel

func (*Font) Italic added in v0.4.0

func (f *Font) Italic() (bool, error)

func (*Font) Name added in v0.4.0

func (f *Font) Name() (string, error)

Name gets the font name.

REFERENCES::

func (*Font) Releaser added in v0.4.0

func (f *Font) Releaser() *Releaser

func (*Font) SetBold added in v0.4.0

func (f *Font) SetBold(isBold bool) error

func (*Font) SetColor added in v0.4.0

func (f *Font) SetColor(color constants.XlRgbColor) error

func (*Font) SetItalic added in v0.4.0

func (f *Font) SetItalic(isItalic bool) error

func (*Font) SetName added in v0.4.0

func (f *Font) SetName(fontName string) error

SetName sets the font name.

REFERENCES::

func (*Font) SetSize added in v0.4.0

func (f *Font) SetSize(fontSize int) error

func (*Font) SetStrikethrough added in v0.4.0

func (f *Font) SetStrikethrough(isStrikethrough bool) error

func (*Font) SetUnderline added in v0.4.0

func (f *Font) SetUnderline(value constants.XlUnderlineStyle) error

func (*Font) Size added in v0.4.0

func (f *Font) Size() (int, error)

func (*Font) Strikethrough added in v0.4.0

func (f *Font) Strikethrough() (bool, error)

func (*Font) Underline added in v0.4.0

func (f *Font) Underline() (constants.XlUnderlineStyle, error)

type Goxcel

type Goxcel struct {
	// contains filtered or unexported fields
}

func (*Goxcel) ActiveSheet

func (g *Goxcel) ActiveSheet() (*Worksheet, *Workbook, ReleaseFunc, error)

func (*Goxcel) ActiveWindow

func (g *Goxcel) ActiveWindow() (*Window, error)

func (*Goxcel) ActiveWorkbook

func (g *Goxcel) ActiveWorkbook() (*Workbook, ReleaseFunc, error)

func (*Goxcel) ComObject

func (g *Goxcel) ComObject() *ole.IDispatch

func (*Goxcel) DisplayAlerts added in v0.5.10

func (g *Goxcel) DisplayAlerts() (bool, error)

func (*Goxcel) EnableEvents added in v0.5.10

func (g *Goxcel) EnableEvents() (bool, error)

func (*Goxcel) Goxcel added in v0.4.0

func (g *Goxcel) Goxcel() *Goxcel

func (*Goxcel) MustSetVisible added in v0.5.15

func (g *Goxcel) MustSetVisible(value bool)

func (*Goxcel) MustSilent added in v0.5.15

func (g *Goxcel) MustSilent(visible bool)

func (*Goxcel) MustWorkbooks added in v0.5.15

func (g *Goxcel) MustWorkbooks() *Workbooks

func (*Goxcel) Releaser added in v0.1.3

func (g *Goxcel) Releaser() *Releaser

func (*Goxcel) ScreenUpdating added in v0.5.10

func (g *Goxcel) ScreenUpdating() (bool, error)

func (*Goxcel) SetDisplayAlerts

func (g *Goxcel) SetDisplayAlerts(value bool) error

func (*Goxcel) SetEnableEvents added in v0.5.10

func (g *Goxcel) SetEnableEvents(value bool) error

func (*Goxcel) SetScreenUpdating added in v0.5.10

func (g *Goxcel) SetScreenUpdating(value bool) error

func (*Goxcel) SetVisible

func (g *Goxcel) SetVisible(value bool) error

func (*Goxcel) Silent added in v0.5.10

func (g *Goxcel) Silent(visible bool) error

func (*Goxcel) Workbooks

func (g *Goxcel) Workbooks() (*Workbooks, error)

type GoxcelObject added in v0.4.0

type GoxcelObject interface {
	HasGoxcel
	ComReleaser
}

noinspection GoNameStartsWithPackageName

type HPageBreak added in v0.5.0

type HPageBreak struct {
	// contains filtered or unexported fields
}

func NewHPageBreak added in v0.5.0

func NewHPageBreak(hpbs *HPageBreaks, comObj *ole.IDispatch) *HPageBreak

func (*HPageBreak) ComObject added in v0.5.0

func (hpb *HPageBreak) ComObject() *ole.IDispatch

func (*HPageBreak) Goxcel added in v0.5.0

func (hpb *HPageBreak) Goxcel() *Goxcel

func (*HPageBreak) Location added in v0.5.0

func (hpb *HPageBreak) Location() (*XlRange, error)

func (*HPageBreak) Releaser added in v0.5.0

func (hpb *HPageBreak) Releaser() *Releaser

func (*HPageBreak) SetLocation added in v0.5.0

func (hpb *HPageBreak) SetLocation(ra *XlRange) error

type HPageBreaks added in v0.5.0

type HPageBreaks struct {
	// contains filtered or unexported fields
}

func NewHPageBreaks added in v0.5.0

func NewHPageBreaks(ws *Worksheet, comObj *ole.IDispatch) *HPageBreaks

func (*HPageBreaks) Add added in v0.5.0

func (hpbs *HPageBreaks) Add(ra *XlRange) error

func (*HPageBreaks) ComObject added in v0.5.0

func (hpbs *HPageBreaks) ComObject() *ole.IDispatch

func (*HPageBreaks) Count added in v0.5.0

func (hpbs *HPageBreaks) Count() (int32, error)

func (*HPageBreaks) Goxcel added in v0.5.0

func (hpbs *HPageBreaks) Goxcel() *Goxcel

func (*HPageBreaks) Item added in v0.5.0

func (hpbs *HPageBreaks) Item(index int) (*HPageBreak, error)

func (*HPageBreaks) Releaser added in v0.5.0

func (hpbs *HPageBreaks) Releaser() *Releaser

func (*HPageBreaks) Walk added in v0.5.0

func (hpbs *HPageBreaks) Walk(walkFn func(hpb *HPageBreak, index int) error) (*HPageBreak, error)

type HasComObject

type HasComObject interface {
	ComObject() *ole.IDispatch
}

noinspection GoNameStartsWithPackageName

type HasGoxcel added in v0.1.2

type HasGoxcel interface {
	Goxcel() *Goxcel
}

noinspection GoNameStartsWithPackageName

type HasReleaser added in v0.1.3

type HasReleaser interface {
	Releaser() *Releaser
}

noinspection GoNameStartsWithPackageName

type HyperLinks struct {
	// contains filtered or unexported fields
}
func NewHyperLinks(ws *Worksheet, comObj *ole.IDispatch) *HyperLinks
func NewHyperLinksFromHyperLinks(hl *HyperLinks, comObj *ole.IDispatch) *HyperLinks

func (*HyperLinks) Add added in v0.6.8

func (hl *HyperLinks) Add(ra *XlRange, address string, subAddress string, screenTip string, textToDisplay string) error

func (*HyperLinks) ComObject added in v0.6.8

func (hl *HyperLinks) ComObject() *ole.IDispatch

func (*HyperLinks) Count added in v0.6.8

func (hl *HyperLinks) Count() (int64, error)

func (*HyperLinks) Delete added in v0.6.8

func (hl *HyperLinks) Delete() error

func (*HyperLinks) Goxcel added in v0.6.8

func (hl *HyperLinks) Goxcel() *Goxcel

func (*HyperLinks) Item added in v0.6.8

func (hl *HyperLinks) Item(index int) (*HyperLinks, error)

func (*HyperLinks) Releaser added in v0.6.8

func (hl *HyperLinks) Releaser() *Releaser

type Interior added in v0.4.0

type Interior struct {
	// contains filtered or unexported fields
}

func NewInterior added in v0.4.0

func NewInterior(cell *Cell, comObj *ole.IDispatch) *Interior

func NewInteriorFromRange added in v0.4.0

func NewInteriorFromRange(ra *XlRange, comObj *ole.IDispatch) *Interior

func (*Interior) Color added in v0.4.0

func (i *Interior) Color() (constants.XlRgbColor, error)

func (*Interior) ComObject added in v0.4.0

func (i *Interior) ComObject() *ole.IDispatch

func (*Interior) Goxcel added in v0.4.0

func (i *Interior) Goxcel() *Goxcel

func (*Interior) Releaser added in v0.4.0

func (i *Interior) Releaser() *Releaser

func (*Interior) SetColor added in v0.4.0

func (i *Interior) SetColor(color constants.XlRgbColor) error

type PageSetup

type PageSetup struct {
	// contains filtered or unexported fields
}

func NewPageSetup

func NewPageSetup(ws *Worksheet, ps *ole.IDispatch) *PageSetup

func (*PageSetup) ComObject

func (p *PageSetup) ComObject() *ole.IDispatch

func (*PageSetup) Goxcel added in v0.1.2

func (p *PageSetup) Goxcel() *Goxcel

func (*PageSetup) Releaser added in v0.1.3

func (p *PageSetup) Releaser() *Releaser

func (*PageSetup) SetCenterFooter

func (p *PageSetup) SetCenterFooter(value interface{}) error

func (*PageSetup) SetCenterHeader

func (p *PageSetup) SetCenterHeader(value interface{}) error

func (*PageSetup) SetOrientation

func (p *PageSetup) SetOrientation(value constants.XlPageOrientation) error

type ReleaseFunc

type ReleaseFunc func()

type Releaser

type Releaser struct {
	// contains filtered or unexported fields
}

func NewReleaser

func NewReleaser() *Releaser

func (*Releaser) Add

func (r *Releaser) Add(f func() error)

func (*Releaser) Count added in v0.1.3

func (r *Releaser) Count() int

func (*Releaser) Release

func (r *Releaser) Release() error

type Shape added in v0.5.0

type Shape struct {
	// contains filtered or unexported fields
}

func NewShape added in v0.5.0

func NewShape(ss *Shapes, c *ole.IDispatch) *Shape

func (*Shape) ComObject added in v0.5.0

func (s *Shape) ComObject() *ole.IDispatch

func (*Shape) Goxcel added in v0.5.0

func (s *Shape) Goxcel() *Goxcel

func (*Shape) Releaser added in v0.5.0

func (s *Shape) Releaser() *Releaser

func (*Shape) TopLeftCell added in v0.5.0

func (s *Shape) TopLeftCell() (*XlRange, error)

func (*Shape) Type added in v0.5.0

func (s *Shape) Type() (constants.MsoShapeType, error)

type Shapes added in v0.5.0

type Shapes struct {
	// contains filtered or unexported fields
}

func NewShapesFromWorksheet added in v0.5.0

func NewShapesFromWorksheet(ws *Worksheet, comObj *ole.IDispatch) *Shapes

func (*Shapes) AddPicture added in v0.5.12

func (ss *Shapes) AddPicture(filename string, left, top, width, height int) error

func (*Shapes) ComObject added in v0.5.0

func (ss *Shapes) ComObject() *ole.IDispatch

func (*Shapes) Count added in v0.5.0

func (ss *Shapes) Count() (int32, error)

func (*Shapes) Goxcel added in v0.5.0

func (ss *Shapes) Goxcel() *Goxcel

func (*Shapes) Item added in v0.5.0

func (ss *Shapes) Item(index int) (*Shape, error)

func (*Shapes) Releaser added in v0.5.0

func (ss *Shapes) Releaser() *Releaser

func (*Shapes) Walk added in v0.5.0

func (ss *Shapes) Walk(walkFn func(s *Shape, index int) error) (*Shape, error)

type VPageBreak added in v0.5.0

type VPageBreak struct {
	// contains filtered or unexported fields
}

func NewVPageBreak added in v0.5.0

func NewVPageBreak(vpbs *VPageBreaks, comObj *ole.IDispatch) *VPageBreak

func (*VPageBreak) ComObject added in v0.5.0

func (vpb *VPageBreak) ComObject() *ole.IDispatch

func (*VPageBreak) Goxcel added in v0.5.0

func (vpb *VPageBreak) Goxcel() *Goxcel

func (*VPageBreak) Location added in v0.5.0

func (vpb *VPageBreak) Location() (*XlRange, error)

func (*VPageBreak) Releaser added in v0.5.0

func (vpb *VPageBreak) Releaser() *Releaser

func (*VPageBreak) SetLocation added in v0.5.0

func (vpb *VPageBreak) SetLocation(ra *XlRange) error

type VPageBreaks added in v0.5.0

type VPageBreaks struct {
	// contains filtered or unexported fields
}

func NewVPageBreaks added in v0.5.0

func NewVPageBreaks(ws *Worksheet, comObj *ole.IDispatch) *VPageBreaks

func (*VPageBreaks) Add added in v0.5.0

func (vpbs *VPageBreaks) Add(ra *XlRange) error

func (*VPageBreaks) ComObject added in v0.5.0

func (vpbs *VPageBreaks) ComObject() *ole.IDispatch

func (*VPageBreaks) Count added in v0.5.0

func (vpbs *VPageBreaks) Count() (int32, error)

func (*VPageBreaks) Goxcel added in v0.5.0

func (vpbs *VPageBreaks) Goxcel() *Goxcel

func (*VPageBreaks) Item added in v0.5.0

func (vpbs *VPageBreaks) Item(index int) (*VPageBreak, error)

func (*VPageBreaks) Releaser added in v0.5.0

func (vpbs *VPageBreaks) Releaser() *Releaser

func (*VPageBreaks) Walk added in v0.5.0

func (vpbs *VPageBreaks) Walk(walkFn func(hpb *VPageBreak) error) (*VPageBreak, error)

type Window

type Window struct {
	// contains filtered or unexported fields
}

func NewWindow

func NewWindow(g *Goxcel, w *ole.IDispatch) *Window

func (*Window) ComObject

func (w *Window) ComObject() *ole.IDispatch

func (*Window) Goxcel added in v0.1.2

func (w *Window) Goxcel() *Goxcel

func (*Window) Releaser added in v0.1.3

func (w *Window) Releaser() *Releaser

func (*Window) SetZoom

func (w *Window) SetZoom(zoomRate int) error

type Workbook

type Workbook struct {
	// contains filtered or unexported fields
}

func (*Workbook) Close

func (w *Workbook) Close() error

func (*Workbook) ComObject

func (w *Workbook) ComObject() *ole.IDispatch

func (*Workbook) ExportAsFixedFormat added in v0.6.3

func (w *Workbook) ExportAsFixedFormat(fmtType constants.XlFixedFormatType, path string) error

func (*Workbook) Goxcel added in v0.1.2

func (w *Workbook) Goxcel() *Goxcel

func (*Workbook) MustSave added in v0.6.9

func (w *Workbook) MustSave()

func (*Workbook) MustSaveAs added in v0.6.9

func (w *Workbook) MustSaveAs(filePath string)

func (*Workbook) MustSheets added in v0.5.15

func (w *Workbook) MustSheets(index int) *Worksheet

func (*Workbook) MustWorkSheets added in v0.5.16

func (w *Workbook) MustWorkSheets() *Worksheets

func (*Workbook) PrintOut added in v0.6.3

func (w *Workbook) PrintOut() error

func (*Workbook) Releaser added in v0.1.3

func (w *Workbook) Releaser() *Releaser

func (*Workbook) Save

func (w *Workbook) Save() error

func (*Workbook) SaveAs

func (w *Workbook) SaveAs(filePath string) error

func (*Workbook) SaveAsWithFileFormat

func (w *Workbook) SaveAsWithFileFormat(filePath string, format constants.XlFileFormat) error

func (*Workbook) SetSaved

func (w *Workbook) SetSaved(value bool) error

func (*Workbook) Sheets

func (w *Workbook) Sheets(index int) (*Worksheet, error)

func (*Workbook) WorkSheets

func (w *Workbook) WorkSheets() (*Worksheets, error)

type Workbooks

type Workbooks struct {
	// contains filtered or unexported fields
}

func NewWorkbooks

func NewWorkbooks(g *Goxcel, wbs *ole.IDispatch) *Workbooks

func (*Workbooks) Add

func (w *Workbooks) Add() (*Workbook, ReleaseFunc, error)

func (*Workbooks) ComObject

func (w *Workbooks) ComObject() *ole.IDispatch

func (*Workbooks) Goxcel added in v0.1.2

func (w *Workbooks) Goxcel() *Goxcel

func (*Workbooks) MustAdd added in v0.5.15

func (w *Workbooks) MustAdd() (*Workbook, ReleaseFunc)

func (*Workbooks) MustOpen added in v0.5.15

func (w *Workbooks) MustOpen(filePath string) (*Workbook, ReleaseFunc)

func (*Workbooks) Open

func (w *Workbooks) Open(filePath string) (*Workbook, ReleaseFunc, error)

func (*Workbooks) Releaser added in v0.1.3

func (w *Workbooks) Releaser() *Releaser

type Worksheet

type Worksheet struct {
	// contains filtered or unexported fields
}

func NewWorksheet

func NewWorksheet(wb *Workbook, ws *ole.IDispatch) *Worksheet

func NewWorksheetFromWorksheets added in v0.4.0

func NewWorksheetFromWorksheets(ws *Worksheets, comObj *ole.IDispatch) *Worksheet

func (*Worksheet) Activate

func (ws *Worksheet) Activate() error

func (*Worksheet) AllRange added in v0.2.0

func (ws *Worksheet) AllRange() (*XlRange, error)

func (*Worksheet) Cells

func (ws *Worksheet) Cells(row int, col int) (*Cell, error)

func (*Worksheet) Columns added in v0.6.0

func (ws *Worksheet) Columns() (*XlRange, error)

func (*Worksheet) ComObject

func (ws *Worksheet) ComObject() *ole.IDispatch

func (*Worksheet) CopySheet added in v0.5.8

func (ws *Worksheet) CopySheet(dest *Worksheet, after bool) error

func (*Worksheet) ExportAsFixedFormat added in v0.5.14

func (ws *Worksheet) ExportAsFixedFormat(fmtType constants.XlFixedFormatType, path string) error

func (*Worksheet) Goxcel added in v0.1.2

func (ws *Worksheet) Goxcel() *Goxcel

func (*Worksheet) HPageBreaks added in v0.5.0

func (ws *Worksheet) HPageBreaks() (*HPageBreaks, error)
func (ws *Worksheet) HyperLinks() (*HyperLinks, error)

func (*Worksheet) MaxCol added in v0.6.0

func (ws *Worksheet) MaxCol(row int) (int32, error)

func (*Worksheet) MaxRow added in v0.6.0

func (ws *Worksheet) MaxRow(col int) (int32, error)

func (*Worksheet) MaxRowCol added in v0.6.0

func (ws *Worksheet) MaxRowCol(row, col int) (maxRow, maxCol int32, err error)

func (*Worksheet) MustCells added in v0.5.15

func (ws *Worksheet) MustCells(row int, col int) *Cell

func (*Worksheet) Name

func (ws *Worksheet) Name() (string, error)

func (*Worksheet) PageSetup

func (ws *Worksheet) PageSetup() (*PageSetup, error)

func (*Worksheet) PrintOut added in v0.6.3

func (ws *Worksheet) PrintOut() error

func (*Worksheet) Range added in v0.2.0

func (ws *Worksheet) Range(startRow, startCol, endRow, endCol int) (*XlRange, error)

func (*Worksheet) Releaser added in v0.1.3

func (ws *Worksheet) Releaser() *Releaser

func (*Worksheet) ResetAllPageBreaks added in v0.6.4

func (ws *Worksheet) ResetAllPageBreaks() error

func (*Worksheet) Rows added in v0.6.0

func (ws *Worksheet) Rows() (*XlRange, error)

func (*Worksheet) SetName added in v0.5.8

func (ws *Worksheet) SetName(name string) error

func (*Worksheet) Shapes added in v0.5.0

func (ws *Worksheet) Shapes() (*Shapes, error)

func (*Worksheet) UsedRange added in v0.6.4

func (ws *Worksheet) UsedRange() (*XlRange, error)

func (*Worksheet) VPageBreaks added in v0.5.0

func (ws *Worksheet) VPageBreaks() (*VPageBreaks, error)

type Worksheets

type Worksheets struct {
	// contains filtered or unexported fields
}

func NewWorkSheets

func NewWorkSheets(wb *Workbook, wss *ole.IDispatch) *Worksheets

func (*Worksheets) Add

func (w *Worksheets) Add() (*Worksheet, error)

func (*Worksheets) AddAfter added in v0.5.1

func (w *Worksheets) AddAfter(ws *Worksheet) (*Worksheet, error)

func (*Worksheets) AddBefore added in v0.5.1

func (w *Worksheets) AddBefore(ws *Worksheet) (*Worksheet, error)

func (*Worksheets) AddLast added in v0.5.1

func (w *Worksheets) AddLast() (*Worksheet, error)

func (*Worksheets) ComObject

func (w *Worksheets) ComObject() *ole.IDispatch

func (*Worksheets) Count

func (w *Worksheets) Count() (int64, error)

func (*Worksheets) Goxcel added in v0.1.2

func (w *Worksheets) Goxcel() *Goxcel

func (*Worksheets) Item

func (w *Worksheets) Item(index int) (*Worksheet, error)

func (*Worksheets) Releaser added in v0.1.3

func (w *Worksheets) Releaser() *Releaser

func (*Worksheets) Walk added in v0.1.1

func (w *Worksheets) Walk(walkFn func(ws *Worksheet, index int) error) (*Worksheet, error)

type XlRange added in v0.1.4

type XlRange struct {
	// contains filtered or unexported fields
}

func NewRange added in v0.1.4

func NewRange(ws *Worksheet, r *ole.IDispatch) *XlRange

func NewRangeFromCell added in v0.6.0

func NewRangeFromCell(cell *Cell, c *ole.IDispatch) *XlRange

func NewRangeFromHPageBreak added in v0.5.0

func NewRangeFromHPageBreak(hpb *HPageBreak, c *ole.IDispatch) *XlRange

func NewRangeFromRange added in v0.4.0

func NewRangeFromRange(ra *XlRange, c *ole.IDispatch) *XlRange

func NewRangeFromShape added in v0.5.0

func NewRangeFromShape(s *Shape, c *ole.IDispatch) *XlRange

func NewRangeFromVPageBreak added in v0.5.0

func NewRangeFromVPageBreak(vpb *VPageBreak, c *ole.IDispatch) *XlRange

func NewRangeFromWorksheet added in v0.6.4

func NewRangeFromWorksheet(ws *Worksheet, c *ole.IDispatch) *XlRange

func (*XlRange) Cells added in v0.1.4

func (r *XlRange) Cells(row int, col int) (*Cell, error)

func (*XlRange) Clear added in v0.4.0

func (r *XlRange) Clear() error

func (*XlRange) Column added in v0.5.0

func (r *XlRange) Column() (int32, error)

func (*XlRange) Columns added in v0.2.0

func (r *XlRange) Columns() (*XlRange, error)

func (*XlRange) ComObject added in v0.1.4

func (r *XlRange) ComObject() *ole.IDispatch

func (*XlRange) CopyPicture added in v0.6.5

func (r *XlRange) CopyPicture(appearance constants.XlPictureAppearance, format constants.XlCopyPictureFormat) error

func (*XlRange) CopyPictureToFile added in v0.6.5

func (r *XlRange) CopyPictureToFile(writer io.Writer, appearance constants.XlPictureAppearance, format constants.XlCopyPictureFormat) error

func (*XlRange) Count added in v0.2.0

func (r *XlRange) Count() (int32, error)

func (*XlRange) Font added in v0.4.0

func (r *XlRange) Font() (*Font, error)

func (*XlRange) Goxcel added in v0.1.4

func (r *XlRange) Goxcel() *Goxcel

func (*XlRange) Interior added in v0.4.0

func (r *XlRange) Interior() (*Interior, error)

func (*XlRange) MustSetValue added in v0.6.4

func (r *XlRange) MustSetValue(value any)

func (*XlRange) PageBreak added in v0.6.4

func (r *XlRange) PageBreak(pageBreakType constants.XlPageBreak) error

func (*XlRange) Releaser added in v0.1.4

func (r *XlRange) Releaser() *Releaser

func (*XlRange) Row added in v0.5.0

func (r *XlRange) Row() (int32, error)

func (*XlRange) Rows added in v0.2.0

func (r *XlRange) Rows() (*XlRange, error)

func (*XlRange) Select added in v0.6.5

func (r *XlRange) Select() error

func (*XlRange) SetNumberFormatLocal added in v0.5.2

func (r *XlRange) SetNumberFormatLocal(format constants.NumberFormatLocal) error

func (*XlRange) SetValue added in v0.5.0

func (r *XlRange) SetValue(value interface{}) error

func (*XlRange) Value added in v0.5.0

func (r *XlRange) Value() (interface{}, error)

func (*XlRange) Walk added in v0.2.0

func (r *XlRange) Walk(walkFn func(r *XlRange, c *Cell, row, col int) error) (*Cell, error)

Directories

Path Synopsis
Package constants パッケージには、Visual Basic の Excel列挙体の一覧が定義されています。
Package constants パッケージには、Visual Basic の Excel列挙体の一覧が定義されています。
examples

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL