Tag Archives: java

How to read Excel (.xlsx) file in java?

Questions: From a given .xlsx file, I am trying to read data using Java. My code for reading the file is as follows: public static void main(String[] args) throws Exception { FileInputStream file = new FileInputStream(new File(“E:\\test1.xlsx”)); XSSFWorkbook workbook = new XSSFWorkbook(file); XSSFSheet test = workbook.getSheetAt(0); student emp = new student(); Iterator<Row> itr = test.iterator();… Read More »

how to check lottery wining numbers javascript

Questions: Objective I wish to query a excel spread sheet to check the numbers entered in the html form are winning numbers. Winning numbers winning numbers would be if the first, second, third, fourth fifth, and sixth number entered in the HTML matches the numbers in excel spread sheet in the same row in columns… Read More »

Access rights to an Excel file created with Java

Questions: I’m creating an Excel file and it should be read-only. To do this I use: (sheetName).getSettings().setProtected(true); for every new sheet added. Only someone with admin rights can get full access to the file, so after confirming a user has admin rights I do: (workbookName).getSheet(0).getSettings().setProtected(false); After someone with admin rights opens the file, it is… Read More »

how to run and control an excel instance from java

Questions: My java application has a button which should open a user selected Excel file when clicked. On this file the user has to select a diagram. Finally they should click a button which triggers a process (macro, java method?) which changes the size of the diagram to values read from an object of the… Read More »

odbc excel java

Questions: I am using JDBC-ODBC DSN-less connection to connect to ms-excel file. I was able to query the excel file using query of form SELECT * FROM [Sheet1$] However this requires me to know the name of the Sheet in excel file (which may not always be Sheet1). Is there any way I can query… Read More »

How to Read an Excel Personal Macro from java with Jacob

Questions: I got to execute a macro of a excel file from jacob, but now i want to execute a personal.xlsb!mymacro and my java program throw error. I don’t know how to write the name of the personal macro, i put: String file=”D:/Aprogramas/EclipseJEE/temp/Libro2.xlsm” public boolean openFile`(String file) { try { final String macroName = “!PERSONAL.XLSB!Auto_abrir”;… Read More »