AddLayers() failed to add sheet with data


Version: 2024

Type: Bug Fixes

Category: Programming

Subcategory:

Jira: ORG-27793


Prepare Book1 and Book2 with data, compile and run below code,

#include <Origin.h>
void Page_AddLayers_Ex1(){
    WorksheetPage wb1("Book1");  
    WorksheetPage wb2("Book2");   
    wb1.AddLayers(wb2);   
    set_active_layer(wb1.Layers(1)); 
}

==> No data in the adding sheet.

It also affects the addsheet X-Function tool.

Existed since Origin 2023b and fixed in Origin 2024.