• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Writing data gained by an GUI Form into existing .xlsm Excel file

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am developing a tool which should read out data from a GUI Form
and write them into an existing .xlsm Exel file. The Form is allready
created and the data from the Form are getting saved in variables
on click at the "save data" button. I researched the possibilities on
how to write into an Excel file and found examples which are using
the apache.poi package. Until now I managed to import the apache
.poi package but when I try to use it, it doesn't work and I only get
several error messages.



Error messages:


17: error: illegal start of type
try {

17: error: ';' expected
try {

20: error: <identifier> expected
workbook = new XSSFWorkbook(

27: error: <identifier> expected
workbook.write(out);

27: error: <identifier> expected
workbook.write(out);

28: error: <identifier> expected
out.close();

29: error: <identifier> expected
System.out.println("xlsm created successfully..");

29: error: illegal start of type
System.out.println("xlsm created successfully..");

31: error: class, interface, or enum expected
} catch (FileNotFoundException e) {

33: error: class, interface, or enum expected
} catch (InvalidFormatException e) {

35: error: class, interface, or enum expected
} catch (IOException e) {

37: error: class, interface, or enum expected
}
12 errors
 
Bartender
Posts: 1810
28
jQuery Netbeans IDE Eclipse IDE Firefox Browser MySQL Database Chrome Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Format your code properly and check your curly braces. You are missing at least one. I'll let you figure out where. (hint: the error message is trying to tell you. Just resolve the first error; forget the others for now)
 
Marshal
Posts: 76825
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

You should learn to write backwards, which will make such errors much easier to find.
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Am I being blind?
I don't see a method definition in there, but I do see a lot of code...
 
Sheriff
Posts: 7123
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Dave Tolls wrote:Am I being blind?


If you are, I am too.
reply
    Bookmark Topic Watch Topic
  • New Topic