Solved

Problem while editing an excel sheet in java

Posted on 2007-12-03
15
974 Views
Last Modified: 2012-05-05
I am editing excel sheets using JExcel API.
If I edit 3rd sheet, next time when I open it using MS Excel 3rd sheet should be displayed default. (As if u do it using MS Excel)

Thanks
0
Comment
Question by:sandeep1984
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
  • +1
15 Comments
 
LVL 35

Accepted Solution

by:
TimYates earned 167 total points
ID: 20401855
According to the documentation,  you can get the settings of a sheet using the getSettings method

http://jexcelapi.sourceforge.net/resources/javadocs/current/docs/jxl/Sheet.html#getSettings()

Then the SheetSettings class has a setSelected method:

http://jexcelapi.sourceforge.net/resources/javadocs/current/docs/jxl/SheetSettings.html#setSelected(boolean)

I've not used it though, but I'd assume this is how it works...

Tim
0
 
LVL 16

Assisted Solution

by:ellandrd
ellandrd earned 333 total points
ID: 20402451
the getSetting() function will only return the setting for a specific sheet so unless you keep track of which sheet you last modified i dont think this function will work.

You could keep track by writing the sheet name to a text file when you write back to your Excel file.

Then do a quick check again when reading from the Excel file.  I have searched nearly all of the documentation and i cannot find any reference to a function that returns the last active or modified sheet.

ellandrd
0
 
LVL 2

Author Comment

by:sandeep1984
ID: 20408815
Thanks.
I am not going to open the excel sheet in my application, it will only be edited.
it will be opened using MS excel only.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 35

Expert Comment

by:TimYates
ID: 20409620
>>  I am not going to open the excel sheet in my application

??

Not sure what you mean here...
0
 
LVL 16

Assisted Solution

by:ellandrd
ellandrd earned 333 total points
ID: 20409646
do you not have to open the file to write to it?

I think your requirement is outside the scope of the Excel API to be honest.
0
 
LVL 16

Expert Comment

by:ellandrd
ID: 20581846
I have no other comments to make on this question.  I have said what i needed to say above.
0
 
LVL 35

Expert Comment

by:TimYates
ID: 20583002
I feel that between myself and Ellandrd, the solution was given

Assuming that's ok with him that is :)

Either the file will need to be opened, the default sheet set, and the file saved again, or it cannot be done with this api...
0
 
LVL 16

Expert Comment

by:ellandrd
ID: 20583200
Vee_Mod

There isnt a solution or are any of the comments above a solution.

If I was the asker, I would probably split the points if I was given help or advise even thought it wasnt a solution to my problem but that is my opinion.

Since the asker hasnt replied since 5th Dec 2007 which we all can see is nearly a month ago, myself and Tim have no idea on the current status of the problem.  Questions like this really tick me off sometimes as the asker might have a solution or workaround from our comments but hasnt bothered to PAQ this question.

Most questions like this usually get deleted without a refund and the experts who helped get nothing out of it.

Tim what do you think?  close it or split for helping?

Ellandrd
0
 
LVL 2

Author Comment

by:sandeep1984
ID: 20588527
Nobody is giving answers which is even near to my question.
I Think this question should be deletd.
0
 
LVL 35

Expert Comment

by:TimYates
ID: 20588701
Abandoning it for a month after we were trying to help you, even when we were asking for clarification to your requirements?

Nice...

Fair enough delete it, but there should be no refund of points...
0
 
LVL 1

Expert Comment

by:Vee_Mod
ID: 20608108
Finalized.
 
Thank you,
 
Vee_Mod
Experts Exchange Moderator
0
 
LVL 16

Expert Comment

by:ellandrd
ID: 20608201
Thanks V!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Java: anonymous class 4 39
collection output issue 9 66
import as existing maven project 3 41
Using jdbcTemplate.batchUpdate to improve INSERT performance 6 27
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question