Open ByungchunBang opened 3 years ago
Maybe you have to clone the worksheet?
grid_memory.AddWorksheet(grid_test.CurrentWorksheet.Clone());
Hi Jingwood, Thanks for your reply. I applied that code but i got same error.
OK, I will check this and reply you if there is a solution.
Hello, @jingwood As to my check with function public Clone(string newName = null) ( line 36 file Reogrid\ReoGrid\Core\Worksheet\Utility.cs ) It always checks workbook not null, then after clone, it's always stick to existing workbook. ( line 38 ) My proposals: 1- Add new function SwitchWorkbook( IWorkbook wb )
2- Change line 36 to public Worksheet Clone(string newName = null, IWorkbook? wb = null)
Let me know what do you think. PS: great work with Reogrid. Thanks for a nice product. Regards, Minh
@smpleader Thank you for your suggestion.
Moving a worksheet from one workbook to another can be a complex process, as named ranges and formulas may still contain references to other worksheets inside the original workbook. I'm considering the following workflow:
The cloning operation is crucial for addressing issues related to references. I recall that the problem lies in the fact that cloning doesn't remove the reference to the old workbook. Perhaps the solution for this issue is to ensure that the cloning process removes the reference from the old workbook. What do you think about this approach?
Hello @jingwood I agree with your approach. In any case, the developer should be aware of referenced cells, at his side. We can consider the extra: 1- Clone a workbook 2- Safe clone: check if any reference of sheet before the clone to new workbook More about scenario: I would like to use Memory workbook as a storage, and show a certain sheet in a different form. Looking forward to hear more from you. Thank you.
Describe the feature
I need custom excel export function. condition
so , i made code as below.
but i got error message. unvell.ReoGrid.WorkbookException: 'Specified worksheet belongs to another workbook, remove from another workbook firstly.'
could you advise ?
Which edition of ReoGrid is targeted