Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is it possible to have a different selection sets on different sheets without duplicate data or fields and use set analysis? We are looking for a general solution for this issue.
Thank you for you suggestions. I agree that this behaviour is exspected, but having different use cases in one applikation this behaviour could be confusing to the user. Building a seperate application is an option.
Back to your suggestion, we already managed to store current selection as bookmark when leaving the sheet. As name of the bookmark we take the ActiveDocument.GetLayout.ActiveSheetId. By activating the sheet we recall the bookmark again. Unfourtunatly while capture the activate event of the sheet ActiveDocument.GetLayout.ActiveSheetId returns the ID of the former (source) sheet not the activated sheet (target). So we didn't manage it to make it completely dynamic. I didn't found an "after event" or Property ActiveDocument.GetLayout.ActivatedSheetId. I also tryed to capture activation event of a sheet object and bind sub on that event with no sucess.
Any suggestion about that?
Thanx
Boris
Boris,
Here is how I'd do this:
First, create a separate bookmark for each sheet. For example, if the sheet names are "A", "B", and "C", so there will be the bookmarks names, just for convenience.
Next, the actions will be like this:
On leave sheet "A", store current selections in bookmark "A". Similar for "B" and "C".
On enter sheet "A", recall bookmark "A".
So, if you user is moving from sheet C to sheet A, the current selection is recorded into bookmark C (by "on leave"), and the bookmark A is recalled (by "on enter") to restore the last selection made on sheet A.
Yes, indeed this is how we tried to manage it also..
In your solution you need a macro for every single sheet, right?. What we try to do is to keep it dynamic by naming the bookmark like the sheet id. On this way we had problems to get the sheet name while restoring the bookmark, because on activate event of the sheet we get the name of the sheet you actualy leaving, no the one you like to restore... Any suggestions about that?
Actually youd need two macros per sheet in my approach - one for "leave", and one for "enter".
I suggest to keep bokmark names static. Otherwise you probably need variablse to store sheet ids fo the sheets you leave or enter.