473,748 Members | 11,145 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_machinena me) 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 3456
"Looch" <lu**********@y ahoo.comwrote in message
news:11******** *************@h 2g2000hsg.googl egroups.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_machinena me) 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**********@y ahoo.comwrote in message
news:11******** **************@ q75g2000hsh.goo glegroups.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.WriteF ile, 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**********@y ahoo.comwrote in message
news:11******** *************@h 2g2000hsg.googl egroups.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_machinena me) 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.netwr ote:
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.WriteF ile, 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...@y ahoo.comwrote in message

news:11******** *************@h 2g2000hsg.googl egroups.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_machinena me) 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>Untitl ed Page</title>
<script language =vbscript >
dim objExcel
Sub cmdOrderFrm_onc lick()
call OpenWorkbook("C :Temp\test.xls" )
end sub

sub OpenWorkbook(st rLocation)
set objExcel = CreateObject("E xcel.Applicatio n")
objExcel.Visibl e = true
objExcel.Workbo oks.Open (strLocation)
objExcel.UserCo ntrol = true
end sub
</script>
</head>

.....

<body>
.....
<input type =button name=cmdOrderFr m 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.WriteF ile
instead.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Looch" <lu**********@y ahoo.comwrote in message
news:11******** **************@ o5g2000hsb.goog legroups.com...
On Jun 4, 12:53 pm, "Steve C. Orr [MCSD, MVP, CSM, ASP Insider]"
<S...@Orr.netwr ote:
>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.WriteF ile, 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...@y ahoo.comwrote in message

news:11******* **************@ h2g2000hsg.goog legroups.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_machinena me) 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>Untitl ed Page</title>
<script language =vbscript >
dim objExcel
Sub cmdOrderFrm_onc lick()
call OpenWorkbook("C :Temp\test.xls" )
end sub

sub OpenWorkbook(st rLocation)
set objExcel = CreateObject("E xcel.Applicatio n")
objExcel.Visibl e = true
objExcel.Workbo oks.Open (strLocation)
objExcel.UserCo ntrol = true
end sub
</script>
</head>

....

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

</body>
Jun 4 '07 #8
"Looch" <lu**********@y ahoo.comwrote in message
news:11******** *************@q 66g2000hsg.goog legroups.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
50587
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 = WScript.CreateObject("WScript.Network") sPwd = inputbox("Enter password") WshNetwork.MapNetworkDrive "J:", "\\server1\data", false, "xyz_net\John", sPwd Msgbox "Drives has been map successful"
13
35559
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 and extract information from specific worksheets and cells. I'm not really sure how to get started with this process. I ran the COM Makepy utility from my PythonWin (IDE from ActiveSTate),
0
2821
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 then save the data into a client machine (Intranet) as excel page using the excel component (using Excel = Microsoft.Office.Interop.Excel;) in the code. Please help me. I have wasted so many days on this.
1
949
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 engine cannot open the file ''. It is already opened exclusively by another user, or you need permission to view its data. I open the file using this connection string Dim connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data
3
2082
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 String dsExcelExport.Clear() daExcelExport.SelectCommand = New SqlCommand daExcelExport.SelectCommand.Connection =
3
3319
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 button to either export to PDF or to EXCEL. Once the report is generated, the byte array containing the data is put into session and an aspx page is loaded into a hidded iframe that "prints" the report (using the byte array from session) causing...
0
1841
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 code. Imports System.Data.SqlClient Imports System.Web.Configuration Imports System.Web.UI
1
1383
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: objExcel.Workbooks.Open(Page.MapPath("reports\BLCost.xls")) could be the culprit since the Open method returns a reference to a Workbook object that you haven't assigned a variable to. Since you have no variable to explicitly use to destroy the...
5
22822
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, Missing.Value, Missing.Value, Missing.Value, In IIS7, the error is "Microsoft Office Excel cannot access the file ... There are several possible reasons:
0
8989
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8828
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9537
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9367
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9319
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4599
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4869
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.