Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
<body><p>Hi All,</p> <p>I am trying to set a variable with the sheet name and want to use that variable value in edit script to filter data set further. </p> <p>I doing this in the following steps:</p> <p>Step 1> Setting the variable name with the sheetname sub SheetSelection set vSheetName = ActiveDocument.ActiveSheet.GetProperties.Name end sub </p> <p>Step 2> Calling this macro at OnActivateSheet event. </p> <p>Step 3> On the basis of variable vSheetName, loading the following fields in the edit script and getting Error message at the time of loading data : <Field not found - vSheetName></p> <p>Load <br /> <Field1>,<br /> <Field2>,<br /> <Field3><br /> resident Directory<br /> where <Field4> = vSheetName;</p> <p>Please have a look and let me know where i am going wrong. </p> <p>Thanks in advance<vsheetname></vsheetname></p></body>
i thing variable will be access using
set v = ActiveDocument.Variables("vControl")
Try Using
V = Activeocument.ActiveSheet.Variables('Variablename")
Strongs,
Thanks for the reply. I used following expression
Load
<Field1>,
<Field2>,
<Field3>
resident Directory
where <Field4> = = ActiveDocument.Variables("vSheetName");
but it is giving following error,
ACTIVEDOCUMENT.VARIABLES is not a valid function.
Any other way?
Hi mansi
A macro variable is not seen by QV load script.
Make sure your variable exists or create it first (Settings/Variable Overview)
In your macro use
set v = ActiveDocument.GetVariable("vSheetName")
v.SetContent "<sheetname>",true
check with Settings/Variable that you have the correct content in the variable.
In the load refer to the variable with $(vSheetName)
Good luck
Juerg