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

Disaster Recovery Strategy for Elasticsearch

11 Days of Salesforce Storefront Reference Architecture (SFRA) — Day 9: Jobs

Checklist to Hire Professional Python Developers in 2022

Chapter 11 SOLID, Flexible, and Testable Designs

Capybara: Taming the Hydrochoerus

Using AWS Savings Plan and Reserved Instances

Code Smell 55 — Object Orgy

Google Meet Self Attendance Bot ~Sarvesh Wadi

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

Multithreading in Java

Java static can be…

Distributing a Java command-line application: the JVM dependency

Java/ Add Footer to PowerPoint Document