<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Object cannot be created</title><link>https://www.infopathdev.com:443/forums/thread/37526.aspx</link><pubDate>Thu, 22 Jan 2009 11:01:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:37526</guid><dc:creator>paralyzedcitizen</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/37526.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=37526</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi guys,&lt;/p&gt;&lt;p&gt;&amp;nbsp;Thanks to everyone who&amp;#39;s replyed to this thread, your help is greatly appreciated. I have however, figured out the root of the problem. Before publishing the form all is well and the username can be read and wonderful things done with it. But after the form is published my work security steps in and disables ActiveX components within InfoPath forms. If I then try and edit the form further it will pop up an error message about the ActiveX object.&lt;/p&gt;&lt;p&gt;&amp;nbsp;How irritating. &lt;/p&gt;&lt;p&gt;&amp;nbsp;Thanks again everyone.&lt;/p&gt;&lt;p&gt;-Tom &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Object cannot be created</title><link>https://www.infopathdev.com:443/forums/thread/37238.aspx</link><pubDate>Fri, 16 Jan 2009 16:54:07 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:37238</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/37238.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=37238</wfw:commentRss><description>&lt;p&gt;Hi --&lt;/p&gt;
&lt;p&gt;Did you change the trust level on your form? In a quick test, my template had to be full trust to create the Active X object. As far as the error for the line in your edit -- did you change or modify the data structure in your form at all such that the XPath &amp;quot;/my:myFields/my:CustomFields/my:CurrentUser&amp;quot; is no longer pointed to a valid data source node?&lt;/p&gt;</description></item><item><title>Re: Object cannot be created</title><link>https://www.infopathdev.com:443/forums/thread/37233.aspx</link><pubDate>Fri, 16 Jan 2009 15:03:16 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:37233</guid><dc:creator>paralyzedcitizen</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/37233.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=37233</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi,&lt;/p&gt;&lt;p&gt;&amp;nbsp;Thanks wsathip, but I didn&amp;#39;t really extract anything useful from those links. One had a solution but it involed using VBScript instead of JScript and that&amp;#39;s not really an option for me.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Am I not making a simple mistake? such as not declaring something or something equally as silly as that? Although that wouldn&amp;#39;t explain why it worked once and then not the second time.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;EDIT: im also now getting problems with this line&lt;/p&gt;&lt;p&gt;XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:CustomFields/my:CurrentUser&amp;quot;).text=username;&lt;/p&gt;&lt;p&gt;it says its null or not an object! ???&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Object cannot be created</title><link>https://www.infopathdev.com:443/forums/thread/37220.aspx</link><pubDate>Fri, 16 Jan 2009 13:13:50 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:37220</guid><dc:creator>swathip</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/37220.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=37220</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Once go through the below links.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.tek-tips.com/viewthread.cfm?qid=28717&amp;amp;page=43"&gt;http://www.tek-tips.com/viewthread.cfm?qid=28717&amp;amp;page=43&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.webdeveloper.com/forum/archive/index.php/t-98434.html"&gt;http://www.webdeveloper.com/forum/archive/index.php/t-98434.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.eggheadcafe.com/forumarchives/inetserveraspgeneral/Jun2005/post23307972.asp"&gt;http://www.eggheadcafe.com/forumarchives/inetserveraspgeneral/Jun2005/post23307972.asp&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Object cannot be created</title><link>https://www.infopathdev.com:443/forums/thread/37214.aspx</link><pubDate>Fri, 16 Jan 2009 12:05:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:37214</guid><dc:creator>paralyzedcitizen</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/37214.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=37214</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;ah, thank you. that was going to be my next question. No, I&amp;#39;m actually getting the username, the error is in the first line&lt;/p&gt;&lt;p&gt;var wshshell=new ActiveXObject(&amp;quot;wscript.shell&amp;quot;);&lt;/p&gt;&lt;p&gt;&amp;nbsp;Is there something I need to reference or declare? I&amp;#39;m very new to javascript. :( &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Object cannot be created</title><link>https://www.infopathdev.com:443/forums/thread/37213.aspx</link><pubDate>Fri, 16 Jan 2009 12:02:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:37213</guid><dc:creator>Shiva</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/37213.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=37213</wfw:commentRss><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Can you check once, are you getting the username or not? You have to modify code as below,&lt;/p&gt;
&lt;p&gt;XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:CustomFields/my:CurrentUser&amp;quot;)&lt;b&gt;.text&lt;/b&gt; = username;&lt;/p&gt;</description></item><item><title>Object cannot be created</title><link>https://www.infopathdev.com:443/forums/thread/37206.aspx</link><pubDate>Fri, 16 Jan 2009 10:42:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:37206</guid><dc:creator>paralyzedcitizen</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/37206.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=37206</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m having problems with the following code. It worked yesterday but does not work now. What&amp;#39;s going on?! I get an error informing me the the object can not be created. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;function XDocument::OnLoad(eventObj)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;var wshshell=new ActiveXObject(&amp;quot;wscript.shell&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;var username=wshshell.ExpandEnvironmentStrings(&amp;quot;%username%&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:CustomFields/my:CurrentUser&amp;quot;)=username;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>