<?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 VBSCRIPT calling document.Variable(&amp;quot;MyDate&amp;quot;) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/VBSCRIPT-calling-document-Variable-quot-MyDate-quot/m-p/186988#M50836</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use a typename() test instead:&lt;/P&gt;&lt;P&gt;set vbstart = newdoc.Variables("MyDate")&lt;BR /&gt;If &lt;STRONG&gt;typename(vbstart) = "Variable"&lt;/STRONG&gt; then&lt;BR /&gt; vbstart.SetContent StartDate,true&lt;BR /&gt;end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Mar 2010 18:34:46 GMT</pubDate>
    <dc:creator>rwunderlich</dc:creator>
    <dc:date>2010-03-19T18:34:46Z</dc:date>
    <item>
      <title>VBSCRIPT calling document.Variable("MyDate")</title>
      <link>https://community.qlik.com/t5/QlikView/VBSCRIPT-calling-document-Variable-quot-MyDate-quot/m-p/186987#M50835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Some of my documents have "MyDate" variable defined and some dont. I have a code snipped that i posted below that runs for both documents that have the variable and ones that dont. The isnull() is there to test to see if the newdoc.Variables("MyDate") statement actually returned a value. Still, I get an "object required: vbstart" error on this line, "vbstart.SetContent StartDate,&lt;STRONG&gt;true".&lt;/STRONG&gt; I know the object does not exist in my document (for my test case) but how do I test for this so I only execute the SetContent if the variable exists? I tried isnull() and also "if vbstart is Nothing then"... Any ideas? Thanks!&lt;/P&gt;&lt;P&gt;ps, I apologize for how the copy and paste from QV script looks. I'll try and fix it up by putting it into notepad or someting...&lt;/P&gt;&lt;P style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;B&gt;set&lt;/B&gt; vbstart = newdoc.Variables("MyDate")&lt;/P&gt;&lt;P style="font-weight: bold; line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;&lt;/P&gt;&lt;P style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;B&gt;if&lt;/B&gt; &lt;B&gt;not&lt;/B&gt; &lt;B&gt;isnull&lt;/B&gt;(vbstart) &lt;B&gt;then&lt;/B&gt;&lt;/P&gt;&lt;P style="line-height: normal; text-indent: 36pt; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;vbstart.SetContent StartDate,&lt;B&gt;true&lt;/B&gt;&lt;/P&gt;&lt;P style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;B&gt;end&lt;/B&gt; &lt;B&gt;if&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;B&gt;&lt;/B&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;B&gt;&lt;/B&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Mar 2010 17:36:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VBSCRIPT-calling-document-Variable-quot-MyDate-quot/m-p/186987#M50835</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-19T17:36:38Z</dc:date>
    </item>
    <item>
      <title>VBSCRIPT calling document.Variable("MyDate")</title>
      <link>https://community.qlik.com/t5/QlikView/VBSCRIPT-calling-document-Variable-quot-MyDate-quot/m-p/186988#M50836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use a typename() test instead:&lt;/P&gt;&lt;P&gt;set vbstart = newdoc.Variables("MyDate")&lt;BR /&gt;If &lt;STRONG&gt;typename(vbstart) = "Variable"&lt;/STRONG&gt; then&lt;BR /&gt; vbstart.SetContent StartDate,true&lt;BR /&gt;end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Mar 2010 18:34:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VBSCRIPT-calling-document-Variable-quot-MyDate-quot/m-p/186988#M50836</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2010-03-19T18:34:46Z</dc:date>
    </item>
    <item>
      <title>VBSCRIPT calling document.Variable("MyDate")</title>
      <link>https://community.qlik.com/t5/QlikView/VBSCRIPT-calling-document-Variable-quot-MyDate-quot/m-p/186989#M50837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Works great. THanks Rob. I was using document.CreateVariable in the meantime but it was a bit of a Kluge.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Mar 2010 18:45:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VBSCRIPT-calling-document-Variable-quot-MyDate-quot/m-p/186989#M50837</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-19T18:45:47Z</dc:date>
    </item>
  </channel>
</rss>

