Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

MACRO

hola, estoy queriendo desactivar una hoja en qlikview adicional a ello estoy manejando por botones multiples selecciones , lo que quiero realizar desde mi boton para ello mediante una macro :

-seleccionar variables y activar en otra hoja la cual es el detalle de mi seleccion

sUB irHoja()

SET sh = ActiveDocument.ActiveSheet

FOR i = 0 to sh.NoOfSheetObjects-1

SET obj = sh.SheetObjects(i)

IF obj.GetObjectType = 5 THEN

IF obj.IsActive THEN

SET v = ActiveDocument.Variables("Choice")

CASE "Area de Transportes, Cascos y Aviación"



ActiveDocument.activatesheet("DETALLE DE BSC").activate

ActiveDocument.fields("VALOR_AREA"). select "2"

ActiveDocument.fields"VALOR_DIVISION"). select "3"

CASE "AREA"

ActiveDocument.activatesheet("DETALLE DE BSC").activate

ActiveDocument.fields("VALOR_AREA"). select "3"

ActiveDocument.fields"VALOR_DIVISION"). select "3"

END SELECT

ELSE

END IF

END IF

NEXT

END SUB

please su ayuda



2 Replies
Not applicable
Author

Hola,

it would be heplful to describe your problem in english Smile

Greets

Not applicable
Author

Hi, I had an inconvenient by selecting information applying SET ANALYSIS and published with a button to an other sheet, because it had to read the text inside the button and identify the selection case

I found the solution for that

SUB macro()
SET sh = ACTIVEDOCUMENT.ActiveSheet
FOR i = 0 to sh.NoOfSheetObjects-1
SET obj = sh.SheetObjects(i)
fr = obj.GetProperties
IF obj.GetObjectType = 5 THEN
IF obj.IsActive THEN
fr.Frame.BorderEffect = 1
a = obj.GetText
SELECT CASE a

CASE "Detalle Riesgos Patrimoniales"
ACTIVEDOCUMENT.SHEETS("SH02").Activate
ACTIVEDOCUMENT.Fields("VALOR_AREA").select "13"
ACTIVEDOCUMENT.Fields("VALOR_DIVISION").select "3"

CASE "Area de Transportes,Cascos y Aviación"
ACTIVEDOCUMENT.SHEETS("SH02").Activate
ACTIVEDOCUMENT.Fields("VALOR_AREA").select "2"
ACTIVEDOCUMENT.Fields("VALOR_DIVISION").select "3"

END SELECT
ELSE
fr.Frame.BorderEffect = 2
END IF
obj.SetProperties fr
END IF
NEXT
END SUB