Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Davidi Millers
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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
 
J. Kevin Robbins
Bartender
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • 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)
 
Campbell Ritchie
Marshal
Posts: 55707
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

You should learn to write backwards, which will make such errors much easier to find.
 
Dave Tolls
Rancher
Posts: 2914
36
  • Mark post as helpful
  • send pies
  • 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...
 
Knute Snortum
Sheriff
Posts: 4073
112
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dave Tolls wrote:Am I being blind?

If you are, I am too.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!