1

I am new to programming and cloud.
I have below code which fetch data from a local drive:

import java.io.FileInputStream;    
import java.io.FileOutputStream;    
import java.io.IOException;    
import java.io.InputStream;    
import java.util.Iterator;    


import org.apache.poi.hssf.usermodel.HSSFCell;    
import org.apache.poi.hssf.usermodel.HSSFRow;    
import org.apache.poi.hssf.usermodel.HSSFSheet;    
import org.apache.poi.hssf.usermodel.HSSFWorkbook;    

import org.apache.poi.xssf.usermodel.XSSFCell;    
import org.apache.poi.xssf.usermodel.XSSFRow;    
import org.apache.poi.xssf.usermodel.XSSFSheet;    
import org.apache.poi.xssf.usermodel.XSSFWorkbook;    

public class ReadExcelFile {    

   public static void readXLSXFile() throws IOException    
   {    
      InputStream ExcelFileToRead = new FileInputStream("C:\\test.xlsx");    
      XSSFWorkbook  wb = new XSSFWorkbook(ExcelFileToRead);    

      XSSFWorkbook test = new XSSFWorkbook();     

      XSSFSheet sheet = wb.getSheetAt(0);    
      XSSFRow row;     
      XSSFCell cell;    

      Iterator rows = sheet.rowIterator();    

      while (rows.hasNext())    
      {    
         row=(XSSFRow) rows.next();    
         Iterator cells = row.cellIterator();    
         while (cells.hasNext())    
         {    
            cell=(XSSFCell) cells.next();    

            if (cell.getCellType() == XSSFCell.CELL_TYPE_STRING)    
            {    
               System.out.print(cell.getStringCellValue()+" ");    
            }    
            else if(cell.getCellType() == XSSFCell.CELL_TYPE_NUMERIC)    
            {    
               System.out.print(cell.getNumericCellValue()+" ");    
            }    
         }    
         System.out.println();    
      }    

   }    


   public static void main(String[] args) throws IOException {     

      readXLSXFile();     

   }    

}    

This codes works well while test.xlsx is in a local drive. But when I want to fetch the data from cloud I receive error "unknown source".
Is there any way to fetch data from excel sheet in cloud programmatically?

Aboriginal
  • 374
  • 1
  • 3
  • 13
  • welcome to SO . please edit your question with some code . declare what you want . ya Ali – Adnan Abdollah Zaki Jul 17 '16 at 04:37
  • Thanks Adnan, My question is vary general and I was wondering whether I can call VBA code in an embedded excel. On getting dipper to the issue I noticed VBA does not work in embedded to web page spread sheet unless is being used as part of javascript or PHP. – Aboriginal Jul 18 '16 at 03:38

0 Answers0