Hi,
Worksheet name must begin with character, cannot be numeric. So if set worksheet name to 10, will auto change to A10.
By the way, you can try to worksheet page name:
void test_get_name()
{
Worksheet wks = Project.ActiveLayer();
string str = wks.GetPage().GetName();
out_str(str);
}
In Origin can put string to worksheet, so no need set worksheet name to numeric. Please change back worksheet name to string and try the following codes to put page names of other worksheet in this folder to the active worksheet first column.
// put other worksheet names to this active worksheet.
void PutNameToWks()
{
Worksheet wks = Project.ActiveLayer();
int nCol = 0; // put to first column
int nRow = 0;
string strName;
Folder fld = Project.ActiveFolder();
foreach(PageBase page in fld.Pages)
{
if(EXIST_WKS == page.GetType())
{
strName = page.GetName();
if( wks.GetPage().GetName() != strName )
{
wks.SetCell(nRow, nCol, strName);
nRow++;
printf("%s\n", strName );
}
}
}
}
Iris Bai
OriginLab