3 Replies Latest reply: Jun 13, 2011 10:45 AM by marco masin RSS

    HIDE a SHEET

    marco masin

      Hello everyone. I have a problem.
      I would like to hide a sheet and make it active only with the clik of a button.
      How do I do?

        • Re: HIDE a SHEET
          Christian Conejero

          Once I used this for that purpose.

          It is a double check. First you have to open Sheet Properties and Show it conditionally to these 2 variables: Contraseña (Password) and Pase (Pass). Also, it is convenient to hide tabs. Using this method, the sheet will not appear in the tool bar Sheets. I´m sure they are other ways. For example by user.

           

          sub contrasena
          Dim PassBox
          Dim Lowercase

          PassBox = InputBox("Por favor, escriba la contraseña", "Contraseña")

          set w = ActiveDocument.Variables("contrasena")
          set v = ActiveDocument.Variables("pase")
          if PassBox = w.GetContent.String then
          v.SetContent "si" , true
          ActiveDocument.ActivateSheet "Administracion"
          Else
          MsgBox "Contraseña Incorrecta", , "Contraseña"

          End if
          end sub   

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

          • Re: HIDE a SHEET
            Miguel Angel Baeyens de Arce

            Hello Marco,

             

            If you don't need additional security, and you only want to show/hide a sheet (instead of an object) using only one button, do the following:

            • Create a variable vSheetVisible (Settings menu, Variable Overview) and set it to 1
            • then create the button, and in the properties, General tab, set its text to

             

            =If(vSheetVisible = 1, 'Hide Sheet', 'Show Sheet')
            

             

            • In the button's properties, go to Actions tab, add External, Set Variable vSheetVisible and value

             

            =If(vSheetVisible = 1, 0, 1)
            

             

            • Now go to the sheet you want to show/hide and click on the background, properties, General tab, Show Sheet, Conditional and set the following condition

             

            vSheetVisible = 1
            

             

            And that's all.

             

            Hope that helps.

             

            Miguel Angel Baeyens

            BI Consultant

            Comex Grupo Ibérica