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

How to Resolve the Issue of Original Cell Borders Disappearing When Using Excelize? #2061

Closed
DeveloperJo opened this issue Jan 2, 2025 · 1 comment · Fixed by #2064
Closed
Labels
bug Something isn't working

Comments

@DeveloperJo
Copy link

In the MS Excel program, I set borders for individual cells.
image

Then, I applied borders to the same cells using the rules in "Conditional Formatting."

image
image
image

After saving and closing the Excel file, when I reopen it and save it again using Excelize, only the borders set through "Conditional Formatting" remain, while the original cell borders disappear.
image

I will attach the test file and provide the source code I developed in Golang.
test.xlsx

package main

import (
	"flag"
	"fmt"

	"github.com/xuri/excelize/v2"
)

func main() {
   file_name := flag.String("file", "", "Input file Name")
   flag.Parse()

   fmt.Println(*file_name, *order_code)

   f, err := excelize.OpenFile(*file_name)
   if err != nil {
      fmt.Println(err)
      return
   }

   tables, err := f.GetTables("Sheet1")
   if err != nil {
      fmt.Println(err)
      return
   }

   fmt.Println(tables)

   if err := f.SaveAs("test1.xlsx",); err != nil {
      fmt.Println(err)
   }
}

Is there a way to resolve this issue?

@xuri xuri added the bug Something isn't working label Jan 2, 2025
@xuri xuri moved this to Bugfix in Excelize v2.9.1 Jan 2, 2025
@xuri xuri added the in progress Working in progress label Jan 2, 2025
Arpelicy added a commit to Arpelicy/excelize that referenced this issue Jan 4, 2025
- Using form template for GitHub issues
- Typo fix for comments of the getSupportedLanguageInfo function
@xuri xuri linked a pull request Jan 4, 2025 that will close this issue
10 tasks
@xuri xuri closed this as completed in #2064 Jan 4, 2025
xuri pushed a commit that referenced this issue Jan 4, 2025
)

- Using form template for GitHub issues
- Typo fix for comments of the getSupportedLanguageInfo function
@xuri
Copy link
Member

xuri commented Jan 4, 2025

Thanks for your issue. This issue has been fixed, please upgrade to the master branch code by following command, this patch will be released on the next version.

go get -u github.com/xuri/excelize/v2@master

@xuri xuri removed the in progress Working in progress label Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Bugfix
Development

Successfully merging a pull request may close this issue.

2 participants