Consulting

Results 1 to 3 of 3

Thread: Active OWC Spreadsheet on a MultiPage

  1. #1

    Active OWC Spreadsheet on a MultiPage

    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

  2. #2
    VBAX Mentor Marcster's Avatar
    Joined
    Jun 2005
    Posts
    434
    Location
    You can use
    [vba]Me.MultiPage1.SelectedItem.Caption[/vba]
    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:
    [vba]
    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
    [/vba]

    HTH,

    Marcster.

  3. #3
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •