By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,684 Members | 1,439 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,684 IT Pros & Developers. It's quick & easy.

Cannot Open Excel File

P: n/a
Was hoping I could get some insight on this. I added a text box and
command button to a web page and added the code in the .vb file to
open an existing Excel file based on what was typed in the text box.

I'm getting the

I'm new to ASP so...

Can I have the Excel file anywhere or does it have to be in an IIS/ASP
related folder? (Getting the ASP user not authorized 80070005 error)

I've added every user (IUSR_machinename) and permission I possibly can
and still can't get it to open. (The same code works in a VB app that
I wrote and copied it from).

Thanks for any advice.

Jun 4 '07 #1
Share this Question
Share on Google+
9 Replies


P: n/a
"Looch" <lu**********@yahoo.comwrote in message
news:11*********************@h2g2000hsg.googlegrou ps.com...
Was hoping I could get some insight on this. I added a text box and
command button to a web page and added the code in the .vb file to
open an existing Excel file based on what was typed in the text box.

I'm getting the

I'm new to ASP so...

Can I have the Excel file anywhere or does it have to be in an IIS/ASP
related folder? (Getting the ASP user not authorized 80070005 error)

I've added every user (IUSR_machinename) and permission I possibly can
and still can't get it to open. (The same code works in a VB app that
I wrote and copied it from).
Presumably, you're trying to do server-side automation? Microsoft doesn't
support this because it doesn't work:
http://support.microsoft.com/default...US;q257757#kb2

Fortunately, there are several other possibilities depending on what you are
trying to do...

What are your requirements for interfacing ASP.NET and Excel...?
--
http://www.markrae.net

Jun 4 '07 #2

P: n/a
Mark,

Thanks for your response. The interface between ASP and Excel is very
simple, the only requirement is to open an Excel file who's name
matches the text in the text box. It can either open in the same or a
new window (new preferably) or could open Excel and open the workbook
that way. I was trying to use server-side b/c I'm fairly familiar with
vb.net while my experience with ASP is next to nothing!

Jun 4 '07 #3

P: n/a
"Looch" <lu**********@yahoo.comwrote in message
news:11**********************@q75g2000hsh.googlegr oups.com...
Thanks for your response. The interface between ASP and Excel is very
simple, the only requirement is to open an Excel file who's name
matches the text in the text box. It can either open in the same or a
new window (new preferably) or could open Excel and open the workbook
that way.
Do you need to do anything other than open an Excel workbook in a browser
window...?
I was trying to use server-side b/c I'm fairly familiar with
vb.net while my experience with ASP is next to nothing!
Sure, but you can't do that because it doesn't work - see the Microsoft
support article which explains this...
--
http://www.markrae.net

Jun 4 '07 #4

P: n/a
It would help to see a code sample demonstrating how you're trying to do it.
Meanwhile, I'd suggest you take a look at Response.WriteFile, which will
allow you to store the Excel file pretty much anywhere on the server.
Here's more info:
http://msdn2.microsoft.com/en-us/lib...30(vs.71).aspx

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Looch" <lu**********@yahoo.comwrote in message
news:11*********************@h2g2000hsg.googlegrou ps.com...
Was hoping I could get some insight on this. I added a text box and
command button to a web page and added the code in the .vb file to
open an existing Excel file based on what was typed in the text box.

I'm getting the

I'm new to ASP so...

Can I have the Excel file anywhere or does it have to be in an IIS/ASP
related folder? (Getting the ASP user not authorized 80070005 error)

I've added every user (IUSR_machinename) and permission I possibly can
and still can't get it to open. (The same code works in a VB app that
I wrote and copied it from).

Thanks for any advice.
Jun 4 '07 #5

P: n/a
Do you need to do anything other than open an Excel workbook in a browser
window...?


Just need to open a pre-existing Excel file with the name that matches
what would be entered into a text box.

Jun 4 '07 #6

P: n/a
On Jun 4, 12:53 pm, "Steve C. Orr [MCSD, MVP, CSM, ASP Insider]"
<S...@Orr.netwrote:
It would help to see a code sample demonstrating how you're trying to do it.
Meanwhile, I'd suggest you take a look at Response.WriteFile, which will
allow you to store the Excel file pretty much anywhere on the server.
Here's more info:http://msdn2.microsoft.com/en-us/lib...30(vs.71).aspx

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsiderhttp://SteveOrr.net

"Looch" <lucianoj2...@yahoo.comwrote in message

news:11*********************@h2g2000hsg.googlegrou ps.com...
Was hoping I could get some insight on this. I added a text box and
command button to a web page and added the code in the .vb file to
open an existing Excel file based on what was typed in the text box.
I'm getting the
I'm new to ASP so...
Can I have the Excel file anywhere or does it have to be in an IIS/ASP
related folder? (Getting the ASP user not authorized 80070005 error)
I've added every user (IUSR_machinename) and permission I possibly can
and still can't get it to open. (The same code works in a VB app that
I wrote and copied it from).
Thanks for any advice.- Hide quoted text -

- Show quoted text -
Here's the code I'm using. If I just use a simple HTM file the script
code works, but not in an ASP app. I get an error on page message in
the bottom left.

<head runat="server">
<title>Untitled Page</title>
<script language =vbscript >
dim objExcel
Sub cmdOrderFrm_onclick()
call OpenWorkbook("C:Temp\test.xls")
end sub

sub OpenWorkbook(strLocation)
set objExcel = CreateObject("Excel.Application")
objExcel.Visible = true
objExcel.Workbooks.Open (strLocation)
objExcel.UserControl = true
end sub
</script>
</head>

.....

<body>
.....
<input type =button name=cmdOrderFrm value = "OK" style="z-index:
103; left: 173px; position: absolute; top: 337px" />

</body>

Jun 4 '07 #7

P: n/a
Using client side code for this (as you are attempting) is fraught with a
variety of security related problems.
Therefore I'd suggest using a server side technique like response.WriteFile
instead.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Looch" <lu**********@yahoo.comwrote in message
news:11**********************@o5g2000hsb.googlegro ups.com...
On Jun 4, 12:53 pm, "Steve C. Orr [MCSD, MVP, CSM, ASP Insider]"
<S...@Orr.netwrote:
>It would help to see a code sample demonstrating how you're trying to do
it.
Meanwhile, I'd suggest you take a look at Response.WriteFile, which will
allow you to store the Excel file pretty much anywhere on the server.
Here's more
info:http://msdn2.microsoft.com/en-us/lib...30(vs.71).aspx

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsiderhttp://SteveOrr.net

"Looch" <lucianoj2...@yahoo.comwrote in message

news:11*********************@h2g2000hsg.googlegro ups.com...
Was hoping I could get some insight on this. I added a text box and
command button to a web page and added the code in the .vb file to
open an existing Excel file based on what was typed in the text box.
I'm getting the
I'm new to ASP so...
Can I have the Excel file anywhere or does it have to be in an IIS/ASP
related folder? (Getting the ASP user not authorized 80070005 error)
I've added every user (IUSR_machinename) and permission I possibly can
and still can't get it to open. (The same code works in a VB app that
I wrote and copied it from).
Thanks for any advice.- Hide quoted text -

- Show quoted text -

Here's the code I'm using. If I just use a simple HTM file the script
code works, but not in an ASP app. I get an error on page message in
the bottom left.

<head runat="server">
<title>Untitled Page</title>
<script language =vbscript >
dim objExcel
Sub cmdOrderFrm_onclick()
call OpenWorkbook("C:Temp\test.xls")
end sub

sub OpenWorkbook(strLocation)
set objExcel = CreateObject("Excel.Application")
objExcel.Visible = true
objExcel.Workbooks.Open (strLocation)
objExcel.UserControl = true
end sub
</script>
</head>

....

<body>
....
<input type =button name=cmdOrderFrm value = "OK" style="z-index:
103; left: 173px; position: absolute; top: 337px" />

</body>
Jun 4 '07 #8

P: n/a
"Looch" <lu**********@yahoo.comwrote in message
news:11*********************@q66g2000hsg.googlegro ups.com...
>Do you need to do anything other than open an Excel workbook in a browser
window...?

Just need to open a pre-existing Excel file with the name that matches
what would be entered into a text box.
Presumably, this Excel file is on the webserver somewhere...?
--
http://www.markrae.net

Jun 4 '07 #9

P: n/a
Presumably, this Excel file is on the webserver somewhere...?
Yes. (Would like to move to a separate file server at some point but
on the webserver (IIS on Win XP Pro) for now is ok).
>
--http://www.markrae.net

Jun 4 '07 #10

This discussion thread is closed

Replies have been disabled for this discussion.