Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6567863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:23:14+00:00 2026-05-25T14:23:14+00:00

Is there a way to get all embedded objects in .xlsx file using xssf

  • 0

Is there a way to get all embedded objects in .xlsx file using xssf event model api?

Usermodel has the method workbook.getallembedds…similarly is there anything in eventmodel?

This is an example in usermodel.I want to implement the same functionality using eventusermodel.Kindly help.

 for (PackagePart pPart : workbook.getAllEmbedds()) {
 String contentType = pPart.getContentType(); 
 if (contentType.equals(------)

Instead of xssfworkbook(in usermodel), in the eventmodel code i have a containerObject of type OPCPackage.

@Gagravarr : Thanks for your reply. I tried using the method suggested by you…but im unable to get the contents of the embedded excel.Could you please help me find out where I am going wrong.Here is a part of the code:

      ReadOnlySharedStringsTable strings = new ReadOnlySharedStringsTable(container);
      XSSFReader xssfReader = new XSSFReader(container);

      XSSFReader.SheetIterator iter = (XSSFReader.SheetIterator)xssfReader.getSheetsData();
      for(PackageRelationship rel : iter.getSheetPart().getRelationshipsByType(XSSFRelation.OLEEMBEDDINGS.getRelation()))
                  embedds.add(getTargetPart(rel));

          for (PackagePart pPart :getAllEmbedds()) {

              String contentType = pPart.getContentType();


              // Excel Workbook - OpenXML file format
               if (contentType.equals("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml")) {
                OPCPackage excelObject = OPCPackage.open(pPart.getInputStream());

`

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:23:14+00:00Added an answer on May 25, 2026 at 2:23 pm

    Finally all I used was this!

      ArrayList<PackagePart> parts = container.getParts();
    
      for (PackagePart pPart :parts) {
    
      String contentType = pPart.getContentType();
    
    
     if (contentType.equals("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")) {
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to get all methods (private, privileged, or public) of a
Is there a way to get all alphabetic chars (A-Z) in an array in
Is there a way in C# to: Get all the properties of a class
Is there a way to get a list of all the GMarkers that have
Is there a way to get the count of rows in all tables in
Is there a way that you can get a collection of all of the
Is there a way to get all the posts from a taxonomy in Wordpress
Is there a way to get the tests inside of a TestCase to run
Is there any way to get the ID of the element that fires an
Is there a way to get the current xml data when we make our

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.