Copy Worksheets Between Excels Request


#1

We have a need to be able to copy a Worksheet from one Excel object to another. Is this something in the near future plans?


#2

We will put your feature request in our work plan. And it will be available in a short time.

However, the new copy method will only copy formatting and data in cells. It will not copy image, chart and other drawing objects.


#3

Thank you!

Is there any idea of a timeframe?

Thanks again,
Matt


#4

Hi Matt,

It will be available within two weeks.


#5

that’s good news…the copying of worksheets from one workbook to another is a requirement for the project we are going to use this type of tool for…regarding the formatting - will it copy the page formatting as well - so if a sheet is configured to be landscape, will the new copy also carry that property over?


#6

Yes. The page setup formatting will also be copyed.


#7

Now it’s available at the latest hotfix. Please refer to Worksheet.Copy method.<OStick out tongue


#8

Laurence,

We are almost done with the evaluation of Aspose.Excel - one outstanding issue is copying a worksheet from one workbook to another.

Here is the scenario:

- create one master workbook with many tabs in it
- using that workbook as a source, create many more workbooks, one at a time, by copying and pasting certain tabs from the master workbook into the new workbooks

Two questions:
1) is there a limit in Aspose.Excel as to the size (in bytes) or in number of tabs of an Excel file (Excel itself doesn’t have a limit on the number of tabs as long as there is available memory to hold them)

2) can you supply a sample of how you would use the Worksheet.Copy method to copy a worksheet (say worksheet 3) from one workbook (say one that was opened from an existing file) to a workbook that was newly created on the fly? I have download the patch referenced in this posting but am not sure how to do this.

Thanks in advance!

Bob


#9
  1. No, there isn’t such a limit.
    2)

    Excel excel1 = new Excel();

    //Load data from designer file and do something
    excel1.Open(…);


    //Copy a worksheet within this workbook
    excel1.AddCopy(…);


    //Create a new workbook and copy worksheet from excel1
    Excel excel2 = new Excel();

    excel2.Worksheet[0].Copy(excel1.Worksheets[0]);