Hello there, (general Kenobi)
I need your help with a trivial problem.
I am trying to select the active layer of a specific worksheet in a project with multiple worksheets.
My code is as followed:
WorksheetPage inpMALDI = Project.WorksheetPages("Book1");
WorksheetPage inpReak = Project.WorksheetPages("Book2");
WorksheetPage calMZ = Project.WorksheetPages("Book3");
Worksheet rawData = inpMALDI.Layers(0);
Worksheet input = inpReak.Layers(0);
Worksheet calculation = calMZ.Layers(0);
I want to use the current active layer of the rawData worksheet to be used in my program.
I looked up several examples and looked up the building of a worksheet.
All examples in origin C use the Project.ActiveLayer()
command, which does not work for me. I need the active layer of “Book1” and not a random woksheet.
The building process of “Worksheet” and “Layer” does not state a way to implement the active layer without using the command mentioned above. I cannot use string names due to dynamic name changes of the layers and this command Worksheet( Layer & layer)
is the way I am using it now (I think). I cannot see a way to implement the active layer onto the Worksheet.
Does anybody know a way to do it?
I am sure I`m reading something wrong at the command description or I`m not thinking of the obvious, because I cannot imagine that it is impossible to implement the active layer of a specific worksheet.
Please tell me where I am reading it wrong as well, so I can learn from my mistakes.
Thank you very much.