Hide or Show Gridlines in Excel in Java

<repositories>
<repository>
<id>com.e-iceblue</id>
<name>e-iceblue</name>
<url>http://repo.e iceblue.com/nexus/content/groups/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>e-iceblue</groupId>
<artifactId>spire.xls.free</artifactId>
<version>3.9.1</version>
</dependency>
</dependencies>
import com.spire.xls.ExcelVersion;
import com.spire.xls.Workbook;
import com.spire.xls.Worksheet;

public class HideOrShowGridlines {

public static void main(String[] args) {

//Create a Workbook object
Workbook workbook = new Workbook();

//Load a sample Excel file
workbook.loadFromFile("C:\\Users\\Administrator\\Desktop\\input.xlsx");

//Get the fisrt worksheet
Worksheet worksheet = workbook.getWorksheets().get(0);

//Hide gridlines
worksheet.setGridLinesVisible(false);

//Show gridlines
//worksheet.setGridLinesVisible(true);

//Save the document
workbook.saveToFile("HideGridlines.xlsx", ExcelVersion.Version2016);
}
}

--

--

--

Sharing Java Code

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Summer ’19 Release: Our favorite new features — Cloud Integrate

What I get from build software from scratch

Introduction to Joystream Founding Members

How to create a multi-platform job on Azure Pipelines

My adventure in Azure

Cloud computing infrastructure models

Stop letting your large enterprise ship bad software.

Quarkworks: Meet the Team Series — Fernando Salazar

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Andrew Wilson

Andrew Wilson

Sharing Java Code

More from Medium

Inheritance In Java -10 Program

The Spring Revolutions 2 —Salient Principles

Java Built-In Functional Interfaces

OOP conecepts in Java