Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the minimal example generated XLSX file has no data #174

Closed
shencan opened this issue Dec 27, 2017 · 1 comment
Closed

the minimal example generated XLSX file has no data #174

shencan opened this issue Dec 27, 2017 · 1 comment

Comments

@shencan
Copy link

shencan commented Dec 27, 2017

Description

I use office 2016(mac os) Excel open the minimal example code generated XLSX file. but There's no data

Steps to reproduce the issue:

  1. copy the minimal example code
  2. run the program
package main

import (
    "fmt"

    "github.com/360EntSecGroup-Skylar/excelize"
)

func main() {
    xlsx := excelize.NewFile()
    // Create a new sheet.
    index := xlsx.NewSheet("Sheet2")
    // Set value of a cell.
    xlsx.SetCellValue("Sheet2", "A2", "Hello world.")
    xlsx.SetCellValue("Sheet1", "B2", 100)
    // Set active sheet of the workbook.
    xlsx.SetActiveSheet(index)
    // Save xlsx file by the given path.
    err := xlsx.SaveAs("./Workbook.xlsx")
    if err != nil {
        fmt.Println(err)
    }
}

Describe the results you received:

Describe the results you expected:

Output of go version:

shencan@MacBook:~/Goscript$ go run write_excel.go
shencan@MacBook:~/Goscript$ ls -l  Workbook.xlsx
-rw-r--r--  1 shencan  staff  5028 12 27 14:09 Workbook.xlsx

image
image

Environment details (OS, Microsoft Excel™ version, physical, etc.):
mac os office 2016 Excel

@xuri
Copy link
Member

xuri commented Dec 27, 2017

Check the Go version you are using. This library needs Go version 1.8 or later. Relate issue #35, #39, #42, #84, #97 and #121.

@xuri xuri closed this as completed Dec 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants