Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to copy shape to another sheet #1308

Open
1 of 2 tasks
juliep10 opened this issue Nov 14, 2019 · 3 comments
Open
1 of 2 tasks

How to copy shape to another sheet #1308

juliep10 opened this issue Nov 14, 2019 · 3 comments

Comments

@juliep10
Copy link

Read and complete the full issue template

Do you want to request a feature or report a bug?

  • Bug

If you are logging a possible bug or feature request, please test with the latest development build first.

Version of ClosedXML

e.g. 0.94.2

What is the current behavior?

Its not copying the shape from one sheet to another sheet in same workbook.

What is the expected behavior or new feature?

Want to copy the sheet same as it's including shape to another sheet.

Did this work in previous versions of our tool? Which versions?

No

Reproducibility

This is an important section. Read it carefully. Failure to do so will cause a 'RTFM' comment.

Without a code sample, it is unlikely that your issue will get attention. Don't be lazy. Do the effort and assist the developers to reproduce your problem. Code samples should be [minimal complete and verifiable](https://stackoverflow.com/hel
tpl_Org.xlsx
Test_copy.xlsx

p/mcve). Sample spreadsheets should be attached whenever applicable. Remove sensitive information.

Code to reproduce problem:

Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
'Accessing the tpl_Org worbook which have sheet which contain shape.
    Dim wb = New XLWorkbook("D:\\ExcelReport\\tpl_Org.xlsx")
        Dim ws = wb.Worksheet(1)
'Create new sheet same as first sheet.
        wb.Worksheet(1).CopyTo("Sheet2")
        wb.SaveAs("D:\\ExcelReport\\Test_copy.xlsx")
End Sub
  • I attached a sample spreadsheet. (You can drag files on to this issue)
@igitur
Copy link
Member

igitur commented Nov 14, 2019

Besides pictures, there's no guarantee that any other shapes will work in ClosedXML yet.

@juliep10
Copy link
Author

Is there any other way using which we can create or copy the sheet to another sheet which is having shape in side it?

@igitur
Copy link
Member

igitur commented Nov 14, 2019

It's possible, but difficult, by using OpenXML directly. I don't know how to do it myself, though.

You can try one of the other 3rd party libraries, e.g. EPPlus too. Maybe they have shape support. I don't know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants