Connecting Tech Pros Worldwide Help | Site Map

Problem with Excel template

Karen A Hodge
Guest
 
Posts: n/a
#1: Nov 18 '05
I have a website that has an Excel template. The template contains 3
QueryTables. The template is located on the web server. I would like to
refresh the data prior to the user opening the template from the website.
This is the code:

wb = excelApp.Workbooks.Add(FilePath)
wb.RefreshAll()
wb.Save()
excelApp.Quit()
.... User opens template

The problem is that the user is prompted for a UserName and Password. It
must be a permission issue because when I run from development in debug, I
do not get a prompt.

How do I get around this? I have given everything but full control on the
folder to the ASPNET account and anything else that look like ASP--I still
get the message.

Thanks in advance.
Karen


Scott Allen
Guest
 
Posts: n/a
#2: Nov 18 '05

re: Problem with Excel template


Hi Karen:

Does the web service require authentication? If you browse to the web
service with Internet Explorer does it prompt you? If the web service
is written in .NET, check in the web.config file to see how the
authentication and authorization sections are set.

--
Scott
http://www.OdeToCode.com

On Sun, 26 Sep 2004 10:27:08 -0700, "Karen A Hodge"
<mshodge@pacbell.net> wrote:
[color=blue]
>I have a website that has an Excel template. The template contains 3
>QueryTables. The template is located on the web server. I would like to
>refresh the data prior to the user opening the template from the website.
>This is the code:
>
>wb = excelApp.Workbooks.Add(FilePath)
>wb.RefreshAll()
>wb.Save()
>excelApp.Quit()
>... User opens template
>
>The problem is that the user is prompted for a UserName and Password. It
>must be a permission issue because when I run from development in debug, I
>do not get a prompt.
>
>How do I get around this? I have given everything but full control on the
>folder to the ASPNET account and anything else that look like ASP--I still
>get the message.
>
>Thanks in advance.
>Karen
>[/color]

Karen Hodge
Guest
 
Posts: n/a
#3: Nov 18 '05

re: Problem with Excel template


I use Forms Authentication. Here is a sample

<!-- AUTHENTICATION
This section sets the authentication policies of the application.
Possible modes are "Windows",
"Forms", "Passport" and "None"
-->
<authentication mode="Forms">
<forms name=".ASPXAUTH" loginUrl="Default.aspx" protection="All" path="/"
timeout="30">
<credentials passwordFormat="Clear">
<user name="LeadershipApplicant" password="d1913st"/>
</credentials>
</forms>
</authentication>


<!-- AUTHORIZATION
This section sets the authorization policies of the application.
You can allow or deny access
to application resources by user or role. Wildcards: "*" mean
everyone, "?" means anonymous
(unauthenticated) users.
-->
<authorization>
<deny users="?"/> <!-- deny unauthenticated Users -->

<!-- <allow users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
<deny users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
-->
</authorization>

<identity impersonate="true"/>


"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:cjkel0pl6q1bf91e92fa8j5o47kkoni0e5@4ax.com...[color=blue]
> Hi Karen:
>
> Does the web service require authentication? If you browse to the web
> service with Internet Explorer does it prompt you? If the web service
> is written in .NET, check in the web.config file to see how the
> authentication and authorization sections are set.
>
> --
> Scott
> http://www.OdeToCode.com
>
> On Sun, 26 Sep 2004 10:27:08 -0700, "Karen A Hodge"
> <mshodge@pacbell.net> wrote:
>[color=green]
> >I have a website that has an Excel template. The template contains 3
> >QueryTables. The template is located on the web server. I would like to
> >refresh the data prior to the user opening the template from the website.
> >This is the code:
> >
> >wb = excelApp.Workbooks.Add(FilePath)
> >wb.RefreshAll()
> >wb.Save()
> >excelApp.Quit()
> >... User opens template
> >
> >The problem is that the user is prompted for a UserName and Password. It
> >must be a permission issue because when I run from development in debug,[/color][/color]
I[color=blue][color=green]
> >do not get a prompt.
> >
> >How do I get around this? I have given everything but full control on the
> >folder to the ASPNET account and anything else that look like ASP--I[/color][/color]
still[color=blue][color=green]
> >get the message.
> >
> >Thanks in advance.
> >Karen
> >[/color]
>[/color]


Scott Allen
Guest
 
Posts: n/a
#4: Nov 18 '05

re: Problem with Excel template


Hi Karen:

It looks as if the webservice requires authentication. In this case
changing security settings on the server will not help (unless you
change the web.config authentication mode).

You'll have to find a way to pass those credentials along with the web
service request from Excel. Do you know if you are using the SOAP
toolkit, or did you write an Office add-in with Visual Studio .NET?

--
Scott
http://www.OdeToCode.com

On Mon, 27 Sep 2004 09:35:07 -0700, "Karen Hodge"
<mshodge@pacbell.net> wrote:
[color=blue]
>I use Forms Authentication. Here is a sample
>
> <!-- AUTHENTICATION
> This section sets the authentication policies of the application.
>Possible modes are "Windows",
> "Forms", "Passport" and "None"
> -->
> <authentication mode="Forms">
> <forms name=".ASPXAUTH" loginUrl="Default.aspx" protection="All" path="/"
>timeout="30">
> <credentials passwordFormat="Clear">
> <user name="LeadershipApplicant" password="d1913st"/>
> </credentials>
> </forms>
> </authentication>
>
>
> <!-- AUTHORIZATION
> This section sets the authorization policies of the application.
>You can allow or deny access
> to application resources by user or role. Wildcards: "*" mean
>everyone, "?" means anonymous
> (unauthenticated) users.
> -->
> <authorization>
> <deny users="?"/> <!-- deny unauthenticated Users -->
>
> <!-- <allow users="[comma separated list of users]"
> roles="[comma separated list of roles]"/>
> <deny users="[comma separated list of users]"
> roles="[comma separated list of roles]"/>
> -->
> </authorization>
>
> <identity impersonate="true"/>
>
>
>"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
>news:cjkel0pl6q1bf91e92fa8j5o47kkoni0e5@4ax.com.. .[color=green]
>> Hi Karen:
>>
>> Does the web service require authentication? If you browse to the web
>> service with Internet Explorer does it prompt you? If the web service
>> is written in .NET, check in the web.config file to see how the
>> authentication and authorization sections are set.
>>
>> --
>> Scott
>> http://www.OdeToCode.com
>>
>> On Sun, 26 Sep 2004 10:27:08 -0700, "Karen A Hodge"
>> <mshodge@pacbell.net> wrote:
>>[color=darkred]
>> >I have a website that has an Excel template. The template contains 3
>> >QueryTables. The template is located on the web server. I would like to
>> >refresh the data prior to the user opening the template from the website.
>> >This is the code:
>> >
>> >wb = excelApp.Workbooks.Add(FilePath)
>> >wb.RefreshAll()
>> >wb.Save()
>> >excelApp.Quit()
>> >... User opens template
>> >
>> >The problem is that the user is prompted for a UserName and Password. It
>> >must be a permission issue because when I run from development in debug,[/color][/color]
>I[color=green][color=darkred]
>> >do not get a prompt.
>> >
>> >How do I get around this? I have given everything but full control on the
>> >folder to the ASPNET account and anything else that look like ASP--I[/color][/color]
>still[color=green][color=darkred]
>> >get the message.
>> >
>> >Thanks in advance.
>> >Karen
>> >[/color]
>>[/color]
>[/color]

Closed Thread