PDA

View Full Version : Active OWC Spreadsheet on a MultiPage



Autofreak
02-28-2006, 03:33 PM
Hello Xperts!

I am using OWC Spreadsheets on a MultiPage and would like to design an elegant way of determining what spreadsheet is activated, or in other words is on the selected page of the MultiPage control. There's only one spreadsheet on each the 5 pages of MultiPage object.

Thanks a lot,
Serge

Marcster
03-01-2006, 02:42 AM
You can use
Me.MultiPage1.SelectedItem.Caption
to determine what page is currently selected.
You need to change MultiPage1 to the name of your Multipage.
It will return the Caption of the page.
So using the above you could use something like:

Select Case Me.MultiPage1.SelectedItem.Caption
Case "Page1"
MsgBox "Spreadsheet1 is currently visible."
Case "Page2"
MsgBox "Spreadsheet2 is currently visible."
Case "Page3"
MsgBox "Spreadsheet3 is currently visible."
Case "Page4"
MsgBox "Spreadsheet4 is currently visible."
Case "Page5"
MsgBox "Spreadsheet5 is currently visible."
Case Else
MsgBox "Unable to determine what Spreadsheet is currently visible."
End Select


HTH,

Marcster.

Autofreak
03-01-2006, 12:21 PM
OK, that's great Marcster, thank you!
However, thru this question I am trying to find a way to adreess individual spreadsheets depending on the selected tab of the MultiPage.

eg. The case block above returns "Spreadsheet1" as the visible spreadsheet, right? Now I would like to work with the Spreadsheet1, for instance

With Me.Spreadsheet1
ActiveSheet.cells(1,1).Value="Now I gotta see this message"
End With


How do I do this trick?

Regards,
Serge