Open aplis1 opened 1 year ago
@aplis1,
Please note, if isVisible() returns "0", it means the sheet is hidden. Anyways, to evaluate your issue precisely, we need your template Excel file. So, kindly zip the Excel file and provide us here. Also, paste your complete sample (runnable) code that you are using. We will check your issue soon.
By the way, we also appreciate if you could post your queries/issue with resource file(s) in the dedicated forum. We handle users efficiently in the forums.
Hi, Thanks for the reply. I will update you soon.
Sure, please take your time.
Hi Amjad,
Sorry for the delay. I have uploaded sample repo including the excel file which has Sheet2 as hidden. In the AsposeUtility class. I have the following -
if (!ws.isVisible()) { logger.info("Hidden sheet found {} ", ws.getName()); } I was expecting for Sheet2 which was hidden to be printed. Please take a look.
@aplis1,
I checked your template Excel file "hiddenexcel2.xlsx" by downloading it from your repos. I found Sheet2 is not hidden at all. When I opened into MS Excel manually, it is shown/displayed, see the screenshot attached.
In short, your assumption regarding Sheet2 is wrong and this sheet is not hidden at all.
Let us know if you still have any issue or confusion.
Hi Amjad,
Sorry I uploaded the correct file with the sheet2 hidden. Please verify.
@aplis1 ,
I tested using your newly uploaded file "hiddenexcel2.xlsx" using the following sample code in a simple console Java program and it works absolutely fine. e.g. Sample code:
Workbook workbook = new Workbook("f:\\files\\hiddenexcel2.xlsx");
for (Object worksheetObj : workbook.getWorksheets()) {
Worksheet ws = (Worksheet) worksheetObj;
if (!ws.isVisible()) {
System.out.println("Hidden sheet found " + ws.getName());
}
}
console output: Hidden sheet found Sheet2
Which version of the API you are using? I am using latest version of the API (Please try latest version/fix: Aspose.Cells for Java 23.5 if you are not already using it).
Thanks It is working now.Not sure how if i am using a wrong excel file. Thanks for the help.
@aplis1 ,
Good to know that your issue is sorted out. In the event of further queries or issue, feel free to write us back.
Hi,
I have a Excel file which contains a hidden sheet. For each sheet in the excel file. If I check like below: Worksheet ws = (Worksheet) worksheetObj; if (ws.isVisible() == false) { logger.info("Hidden sheet found {} ", ws.getName()); }
I never i get to the logger statement because even for the hidden sheet isVisible is always 0. Can somebody help how to know If the sheet is really hidden or not.