This Question is Possibly Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
1 Replies Last post: Jun 12, 2007 12:58 PM by Igor Novikov  
cathy   2 posts since
Jun 7, 2007
Currently Being Moderated

Jun 7, 2007 6:17 PM

Workbook copy contains automatic links to information in another workbook

Hello,

 

I have an Excel file that contains many worksheets with a lot of formulas (accross sheets inside the workbook), but no link to other workbook. I want to enter some values in some cells and get a result appearing in a specific cell.

To do that, I create a writable copy of my file, and just try to save this copy. When I try to open the copy manually, I get an error saying: "The workbook you opened contains automatic links to information in another workbook".

The size of the copy is also not the same as the size of the source file (source=4,774 KB and copy=5.244 KB).

Here is my code:

import java.io.File;

 

import jxl.Workbook;

import jxl.write.WritableWorkbook;

 

public class ExcelFileProcess {

 

    public static void main(String[] args) {

        try{

            String fileName = "MyTemplate2007.xls";

            Workbook workbook = Workbook.getWorkbook(new File(fileName));

            WritableWorkbook copy = Workbook.createWorkbook(new File("output.xls"), workbook);

           

            //WritableSheet inputSheet = copy.getSheet("Inputs");

           

            // write charging structure details

            copy.write();

           

            // Close the workbook

            copy.close();

        } catch (Exception e) {

            e.printStackTrace();

        }

    }

}

 

Could you help please...

Thanks in advance,

 

Cathy

Igor Novikov TeamDev Ltd. 225 posts since
Apr 24, 2006
Currently Being Moderated
1. Jun 12, 2007 12:58 PM in response to: cathy
Re: Workbook copy contains automatic links to information in another workbo

Hi Cathy,

 

In your code you using open source JExcelAPI project. To resolve your task you can try contacting with JExcelAPI team (http://jexcelapi.sourceforge.net).

 

Also you can try using our JExcel product which can be downloaded on following link:

 

http://teamdev.com/jexcel/downloads.jsf

 

Sincerely,

 

Igor Novikov

More Like This

  • Retrieving data ...