<?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>Browser Forms</title><link>https://www.infopathdev.com:443/forums/40.aspx</link><description>For browser form specific questions</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: excelService.OpenWorkbook method throws error: "You do not have permissions to open this file on Excel Services "</title><link>https://www.infopathdev.com:443/forums/thread/30583.aspx</link><pubDate>Fri, 18 Jul 2008 17:11:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30583</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30583.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=30583</wfw:commentRss><description>&lt;p&gt;Perhaps these require your form to be set to full trust? Have you tried changing your form to be full trust?&lt;/p&gt;</description></item><item><title>excelService.OpenWorkbook method throws error: "You do not have permissions to open this file on Excel Services "</title><link>https://www.infopathdev.com:443/forums/thread/30533.aspx</link><pubDate>Thu, 17 Jul 2008 14:41:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30533</guid><dc:creator>poonam.banthia</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30533.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=30533</wfw:commentRss><description>&lt;p&gt;I have used the following code to&amp;nbsp;retrieve values from a excel spreadsheet &amp;nbsp;(&lt;font color="#a31515"&gt;SomeBook.xlsx&lt;/font&gt;), which has been published in the sharepoint site from excel services. The documnet library &lt;font color="#a31515"&gt;&lt;a href="http:"&gt;:/sites/ExcelServices/SpreadSheets/&amp;quot;&amp;gt;http://&amp;lt;servername&amp;gt;:&amp;lt;port number&amp;gt;/sites/ExcelServices/SpreadSheets/&lt;/a&gt;&lt;/font&gt;&amp;nbsp;has&amp;nbsp;been added in the trusted file location and I am able to&amp;nbsp; view the excel from browser also.&amp;nbsp;fyi somebook.xlsx is populated from a custom list&amp;nbsp;residing in the same site as the excel document library&amp;nbsp;using .net code (not using .iqy).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Code:&lt;/p&gt;&lt;font color="#2b91af" size="2"&gt;
&lt;p&gt;ExcelService&lt;/font&gt;&lt;font size="2"&gt; excelService = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;ExcelService&lt;/font&gt;&lt;font size="2"&gt;();&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;excelService.SoapVersion = &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;SoapProtocolVersion&lt;/font&gt;&lt;font size="2"&gt;.Soap12;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;excelService.PreAuthenticate = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;true&lt;/font&gt;&lt;font size="2"&gt;;&lt;/font&gt;&amp;nbsp;&lt;font size="2"&gt;&lt;/p&gt;System.Net.&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;NetworkCredential&lt;/font&gt;&lt;font size="2"&gt; credentials = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; System.Net.&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;NetworkCredential&lt;/font&gt;&lt;font size="2"&gt;(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;username&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;password&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;domain&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font size="2"&gt;excelService.Credentials = credentials;&lt;/font&gt;&lt;font size="2"&gt;&amp;nbsp;&lt;font size="2"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;Status&lt;/font&gt;&lt;font size="2"&gt;[] status = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;null&lt;/font&gt;&lt;font size="2"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; SessionId = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;null&lt;/font&gt;&lt;font size="2"&gt;;&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; pathWorkbook = &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;http://&amp;lt;server name&amp;gt;:&amp;lt;port number&amp;gt;/sites/ExcelServices/SpreadSheets/SomeBook.xlsx&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;SessionId = excelService.OpenWorkbook(pathWorkbook, &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;String&lt;/font&gt;&lt;font size="2"&gt;.Empty, &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;String&lt;/font&gt;&lt;font size="2"&gt;.Empty, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;out&lt;/font&gt;&lt;font size="2"&gt; status);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&amp;nbsp;Now every time the SessionId is returned as null and i get the following error: &lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;"&gt;&lt;font face="Calibri"&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#c00000;"&gt;You do not have permissions to open this file on Excel Services&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#c00000;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#c00000;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;"&gt;at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark&amp;amp; stackMark, Boolean isPermSet)&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#c00000;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp; at System.Security.CodeAccessPermission.Demand()&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#c00000;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp; at System.Net.HttpWebRequest..ctor(Uri uri, ServicePoint servicePoint)&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#c00000;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp; at System.Net.HttpRequestCreator.Create(Uri Uri)&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#c00000;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp; at System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase)&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#c00000;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp; at System.Net.WebRequest.Create(Uri requestUri)&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#c00000;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp; at System.Web.Services.Protocols.WebClientProtocol.GetWebRequest(Uri uri)&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#c00000;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp; at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebRequest(Uri uri)&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#c00000;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp; at System.Web.Services.Protocols.SoapHttpClientProtocol.GetWebRequest(Uri uri)&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#c00000;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp; at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#c00000;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp; at ExcelServices.ExcelWebService.ExcelService.OpenWorkbook(String workbookPath, String uiCultureName, String dataCultureName, Status[]&amp;amp; status)&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#c00000;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp; at ExcelServices.UCExcelService.GetData_Click(Object sender, EventArgs e)&lt;/span&gt;&lt;span style="COLOR:#c00000;"&gt;&lt;/span&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font size="2"&gt;Do you have any suggestions? I have also tried with &lt;font color="#008000"&gt;excelService.Credentials = System.Net.CredentialCache.DefaultCredentials&amp;nbsp;&lt;/font&gt;but no success.&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;
&lt;p style="MARGIN:0in 0in 0pt;"&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font face="Times New Roman"&gt;Thanks!!&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN:0in 0in 0pt;"&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font face="Times New Roman"&gt;Poonam&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;</description></item></channel></rss>