<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Assigning Selection Color in Macro with value from Script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Assigning-Selection-Color-in-Macro-with-value-from-Script/m-p/494138#M184858</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to change the selection colors in one Qlikview application where I have the possibility to define the colors in the load script. When I define the selection color directly in the Macro, everything works well. The macro looks like follows:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MACRO:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Sub SetColorPrefs()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dim UserPrefs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set UserPrefs = ActiveDocument.GetApplication.GetUserPreferences&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3366ff;"&gt;UserPrefs.CustomSelBgColor(1).PrimaryCol.Col = RGB(255,0,0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.GetApplication.SetUserPreferences UserPrefs&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then tried to put the RGB setting in the loadscript in a variable and to refer to the variable in the macro. Unfortunately the macro does not accept this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD SCRIPT:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;set&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;vColor = RGB(255,0,0);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MACRO:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Sub SetColorPrefs()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dim UserPrefs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set User Prefs = ActiveDocument.GetApplication.GetUserPreferences&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;UserPrefs.CustomSelBgColor(1).PrimaryCol.Col = &lt;SPAN style="color: #ff0000;"&gt;ActiveDocument.Variables("vColor").GetContent.String&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.GetApplication.SetUserPreferences UserPrefs&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Overall target is to define the Color Settings in the load script or even in an external file which users can modify easily.&lt;/P&gt;&lt;P&gt;Does anyone have an idea how I can make this work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot in advance for your help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 20 Oct 2013 18:32:58 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-10-20T18:32:58Z</dc:date>
    <item>
      <title>Assigning Selection Color in Macro with value from Script</title>
      <link>https://community.qlik.com/t5/QlikView/Assigning-Selection-Color-in-Macro-with-value-from-Script/m-p/494138#M184858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to change the selection colors in one Qlikview application where I have the possibility to define the colors in the load script. When I define the selection color directly in the Macro, everything works well. The macro looks like follows:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MACRO:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Sub SetColorPrefs()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dim UserPrefs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set UserPrefs = ActiveDocument.GetApplication.GetUserPreferences&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3366ff;"&gt;UserPrefs.CustomSelBgColor(1).PrimaryCol.Col = RGB(255,0,0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.GetApplication.SetUserPreferences UserPrefs&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then tried to put the RGB setting in the loadscript in a variable and to refer to the variable in the macro. Unfortunately the macro does not accept this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD SCRIPT:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;set&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;vColor = RGB(255,0,0);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MACRO:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Sub SetColorPrefs()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dim UserPrefs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set User Prefs = ActiveDocument.GetApplication.GetUserPreferences&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;UserPrefs.CustomSelBgColor(1).PrimaryCol.Col = &lt;SPAN style="color: #ff0000;"&gt;ActiveDocument.Variables("vColor").GetContent.String&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.GetApplication.SetUserPreferences UserPrefs&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Overall target is to define the Color Settings in the load script or even in an external file which users can modify easily.&lt;/P&gt;&lt;P&gt;Does anyone have an idea how I can make this work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot in advance for your help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 Oct 2013 18:32:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assigning-Selection-Color-in-Macro-with-value-from-Script/m-p/494138#M184858</guid>
      <dc:creator />
      <dc:date>2013-10-20T18:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Selection Color in Macro with value from Script</title>
      <link>https://community.qlik.com/t5/QlikView/Assigning-Selection-Color-in-Macro-with-value-from-Script/m-p/494139#M184859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is not a per document setting. The macro changes the user preferences in the setting.ini file somewhere down in the users AppData folder. If your users access the document via Qlikview Server then this setting won't work unless you put it into the settings.ini file on the server. Note that the changed setting will apply to all users for all documents on your Qlikview Server. &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;You could try modifying this extension to do what you want: &lt;/SPAN&gt;&lt;A href="https://community.qlik.com/docs/DOC-3140"&gt;Document Extension to override green selection color&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2013 11:42:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assigning-Selection-Color-in-Macro-with-value-from-Script/m-p/494139#M184859</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-10-21T11:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Selection Color in Macro with value from Script</title>
      <link>https://community.qlik.com/t5/QlikView/Assigning-Selection-Color-in-Macro-with-value-from-Script/m-p/494140#M184860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;In fact RGB() is a VBS function that return a number : &lt;/SPAN&gt;&lt;A href="https://www.w3schools.com/asp/func_rgb.asp" style="font-size: 10pt;" title="https://www.w3schools.com/asp/func_rgb.asp"&gt;https://www.w3schools.com/asp/func_rgb.asp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;gt;&amp;gt; &lt;SPAN style="color: #0000ff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;UserPrefs.CustomSelBgColor(1).PrimaryCol.Co&lt;/SPAN&gt; is waiting for a number !&lt;SPAN style="text-decoration: underline;"&gt; &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The solution is prety simple in fact. Use the Eval() function to "evaluate" the result of your &lt;SPAN style="color: #ff0000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;RGB(255,0,0)&lt;/SPAN&gt; string : &lt;A href="https://www.w3schools.com/asp/func_eval.asp" title="https://www.w3schools.com/asp/func_eval.asp"&gt;https://www.w3schools.com/asp/func_eval.asp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14931410153708432" jivemacro_uid="_14931410153708432"&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Sub SetColorPrefs()&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dim UserPrefs&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set User Prefs = ActiveDocument.GetApplication.GetUserPreferences&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UserPrefs.CustomSelBgColor(1).PrimaryCol.Col = &lt;SPAN style="color: #ff0000;"&gt;Eval(&lt;/SPAN&gt;ActiveDocument.Variables("vColor").GetContent.String&lt;SPAN style="color: #ff0000;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.GetApplication.SetUserPreferences UserPrefs&lt;/P&gt;
&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;End Sub&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works perfectly for me &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 17:28:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assigning-Selection-Color-in-Macro-with-value-from-Script/m-p/494140#M184860</guid>
      <dc:creator>jhamard</dc:creator>
      <dc:date>2017-04-25T17:28:54Z</dc:date>
    </item>
  </channel>
</rss>

