Copying a sheet

Posted by: yianeco on 1 November 2019, 5:58 pm EST

  • Posted 1 November 2019, 5:58 pm EST

    Is there a way to copy a sheet from one workbook to another with all formatting (text, colors, borders etc) ?

    Yiannis
  • Replied 3 November 2019, 8:36 pm EST

    Hi Yiannis,

    In order to accomplish this, you can save a Spread file from a workbook and then, load it into the desired sheet of another workbook. Please refer the following documentation links for more information on this:
    https://help.grapecity.com/spread/Spread8/WebSiteHelp/webframe.html#savedat3.html
    https://help.grapecity.com/spread/Spread8/WebSiteHelp/add_dat9.html#1020604

      Excel file Export and Import:

    https://help.grapecity.com/spread/Spread8/WebSiteHelp/saveda24.html
    https://help.grapecity.com/spread/Spread8/WebSiteHelp/add_da20.html

    Thanks,
    Pragati
  • Replied 3 November 2019, 8:49 pm EST

    Please read again my question carefully!
    I am not talking about excel.
    My question is how to copy one sheet from a spread8 workbook to another spread8 workbook.
    Anyway, how do I load a file (spread8) into a sheet of another workbook ?

    Regards

    Yiannis
  • Replied 3 November 2019, 10:20 pm EST

    Yiannis,

    I got the requirement. You want one sheet (data and formatting) of a workbook to be copied in a sheet of a different workbook. This is why, I suggested two ways.

    You can first save the sheet to a Spread file as follows:
    fpSpread1.SaveToFile "FileName", False


    and, then load the saved file to a sheet of another workbook:
    fpSpread2.LoadFromFile "FileName"


    The another way is to save the file to excel format and then, load the excel file back to a different workbook.

    Thanks.
  • Replied 4 November 2019, 3:48 am EST

    Hi again,
    What you are describing is how to save and open a workbook.
    That was not my request.
    I want to copy a sheet from one workbook to another workbook.
    Can this be done ?

    Regards

    Yiannis
  • Replied 5 November 2019, 7:38 pm EST

    Hi Yiannis.

    I am discussing this with the developers and will get back once there is any information from them.

    Thanks,
    Pragati
  • Replied 8 January 2020, 4:30 pm EST

    Hi Yiannis,

    As per the developer, you can use the ImportExcelSheet method (or SSImportExcelSheet in the DLL control) to load a specified worksheet from a specified Excel file into the workbook – that is the best way to “copy” the sheet from one workbook into another.

    Thanks,
    Pragati
  • Replied 8 January 2020, 4:51 pm EST

    As I said before. My question is how to copy a sheet from spread workbook to another spread workbook and NOT how to copy an excel sheet in a spread workbook!

    Regards

    Yiannis
  • Replied 9 January 2020, 3:54 pm EST

    Hi Yiannis,

    I will get back to you on this shortly.

    Thanks.
  • Marked as Answer

    Replied 13 January 2020, 5:17 pm EST

    Yiannis,

    The methods SaveBlockToBuffer and LoadBlockFromBuffer can be used to copy the contents of a block of cells (which can be the entire sheet):
    https://help.grapecity.com/spread/Spread8/WebSiteHelp/webframe.html#funct316.html
    https://help.grapecity.com/spread/Spread8/WebSiteHelp/webframe.html#funct256.html

    Here, the contents are saved in binary form and the methods are very fast.

    Thanks.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels