473,378 Members | 1,152 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Cannot Open Excel File

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
9 3431
"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
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
"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
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
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
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
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
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Alex Ang | last post by:
I have written the following VBScript program. It is stored into a file "map_drive.vbs". It successfully mapped to a network drive \\server1\data. Dim WshNetwork Set WshNetwork =...
13
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet...
0
by: acharyaks | last post by:
Hi life saver, I am using excel component for the development. The purpose is to connect to excel through the odbc connection string. Then through the connection extract data into a dataset and...
1
by: Morten Wennevik | last post by:
I'm transferring an Excel file from a client computer to a web-page on a server, then trying to open the file on the server causes this exception message to occur. The Microsoft Jet database...
3
by: Agnes | last post by:
Dim dsExcelExport As New System.Data.DataSet Dim daExcelExport As New System.Data.SqlClient.SqlDataAdapter Dim Excel As New Excel.Application Dim strExcelFile As String Dim strFileName As...
3
by: mo | last post by:
I have an application that uses Reporting Services. When the user chooses to print a report, they are taken to a window that allows them to fill in parameters for the report. They then click a...
0
by: Fendi Baba | last post by:
I created an ASP.net page which opens excel. This works fine in Office 2007. However, Excel 2003 runs in an error which states "cannot read output file". Hee is the VB code and below is the ASPX...
1
by: Scott M. | last post by:
Many methods return objects when they are called. With Excel these objects are placed in memory and must be destroyed via ReleaseComObject as you have done with your NAR method, but the line: ...
5
by: abb | last post by:
On a Vista machine, the following code works using the ASP.NET Development Server, but fails in IIS7: book = excel.Workbooks.Open(tempfile, false, false, Missing.Value, Missing.Value,...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.