Independentsoft
Home
Purchase
Support
Company
Contact
JGraph
>
Tutorial
> Get worksheets
The following example shows you how to get all worksheets in a workbook.
import com.independentsoft.graph.GraphClient; import com.independentsoft.graph.GraphException; import com.independentsoft.graph.files.DriveId; import com.independentsoft.graph.workbooks.Worksheet; import java.util.List; public class Sample { public static void main(String[] args) { try { GraphClient client = new GraphClient(); client.setClientId("63333333-209e-454e-b7bd-55a4d201270f"); client.setTenant("independentsoft.onmicrosoft.com"); client.setUsername("info@independentsoft.onmicrosoft.com"); client.setPassword("password"); List
worksheets = client.getWorksheets("workbook-drive-item-id", new DriveId("b!T7ZW_FMzJ02x_G6HteZHZ")); for (int i = 0; i < worksheets.size(); i++) { System.out.println("Name = " + worksheets.get(i).getName()); System.out.println("Id = " + worksheets.get(i).getId()); System.out.println("Visibility = " + worksheets.get(i).getVisibility()); System.out.println(""); } } catch (GraphException e) { System.out.println("Error: " + e.getCode()); System.out.println("Message: " + e.getMessage()); e.printStackTrace(); } } }
Need help? Ask our developers:
Name*
Email*
Message*