473,856 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Open Excel file as read only

Mel
How do I open an Excel file as a read only document? It would be okay
if it opened in the browser window but I don't want the user to save
any changes and stomp over my original file on the network. Can I
somehow save it to the client machine and then open it? What is the
best method?

(using Asp.net 2.0, vb.net)
Nov 14 '08 #1
3 6678
Shooting from the hip here.

The best thign would be to grab in IDataReader on it, and bind it to a
GridView or similar.

http://www.google.com/search?hl=en&q...xcel+&aq=3&oq=

I have a downloadable example here
http://sholliday.space s.live.com/Blog/cns!A68482B9628 A842A!176.entry
for getting an IDataReader reading an Excel file if the google search
doesn't fit the bill.

"Mel" <ML********@gma il.comwrote in message
news:2d******** *************** ***********@k36 g2000pri.google groups.com...
How do I open an Excel file as a read only document? It would be okay
if it opened in the browser window but I don't want the user to save
any changes and stomp over my original file on the network. Can I
somehow save it to the client machine and then open it? What is the
best method?

(using Asp.net 2.0, vb.net)

Nov 16 '08 #2
Mel
On Nov 15, 10:07*pm, "sloan" <sl...@ipass.ne twrote:
Shooting from the hip here.

The best thign would be to grab in IDataReader on it, and bind it to a
GridView or similar.

http://www.google.com/search?hl=en&q...xcel+&aq=3&oq=

I have a downloadable example herehttp://sholliday.space s.live.com/Blog/cns!A68482B9628 A842A!176.entry
for getting an IDataReader reading an Excel file if the google search
doesn't fit the bill.

"Mel" <MLights...@gma il.comwrote in message

news:2d******** *************** ***********@k36 g2000pri.google groups.com...
How do I open an Excel file as a read only document? *It would be okay
if it opened in the browser window but I don't want the user to save
any changes and stomp over my original file on the network. *Can I
somehow save it to the client machine and then open it? *What is the
best method?
(using Asp.net 2.0, vb.net)- Hide quoted text -

- Show quoted text -
Yeah, I linked it to a GridView but the formatting stinks. It's just
not as pretty as the Excel view. I will need to play with the
GridView Column/Row formatting I guess...
Nov 17 '08 #3
Mel
On Nov 15, 10:07*pm, "sloan" <sl...@ipass.ne twrote:
Shooting from the hip here.

The best thign would be to grab in IDataReader on it, and bind it to a
GridView or similar.

http://www.google.com/search?hl=en&q...xcel+&aq=3&oq=

I have a downloadable example herehttp://sholliday.space s.live.com/Blog/cns!A68482B9628 A842A!176.entry
for getting an IDataReader reading an Excel file if the google search
doesn't fit the bill.

"Mel" <MLights...@gma il.comwrote in message

news:2d******** *************** ***********@k36 g2000pri.google groups.com...
How do I open an Excel file as a read only document? *It would be okay
if it opened in the browser window but I don't want the user to save
any changes and stomp over my original file on the network. *Can I
somehow save it to the client machine and then open it? *What is the
best method?
(using Asp.net 2.0, vb.net)- Hide quoted text -

- Show quoted text -
I am looking for something similar to this but when I close the new
browser window it asks if I want to save the changes. I don't want
this option available. Is there any way to work around this?
Protected Sub LinkButton1_Cli ck(ByVal sender As Object, ByVal e As
System.EventArg s)
Response.Redire ct("~/schedules/StockedItemGuid eByLoc.xls")
'open Excel document in a new browser window
End Sub
Nov 17 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2409
by: Matt | last post by:
I want to open a file (Excel spreadsheet) read-only using JavaScript. Can someone tell me if/how this can be done? Thanks in advance, Matt
6
10830
by: Micke | last post by:
Hi, I'm trying to open an Excel file from an aspx with following code: Imports Excel = Microsoft.Office.Interop.Excel Dim oExcel As New Excel.Application Dim oBooks As Excel.Workbooks oBooks.Open("C:\XML\PriceList.xls") All I get is:
2
4170
by: Peter S. | last post by:
I have an ASP.NET page that invokes a web control written in C#. What I want to do is (based on the session ID) display a certain spreadsheet that exists on a network drive. I want the webcontrol to open the spreadsheet using my log on credentials since they won't have priviliges to access their particular file from the network drive. BTW, I am guessing I will have to use HTTP as this file exists in a Sharepoint document library. I can...
0
1955
by: shaurya.rastogi | last post by:
I need to open an Excel file that has been stored in the Access Database using the insert Object functionality of MSAccess manually. What i am aware of is that i cant just read the field containing the Excel File into a Byte Array and pass it to the Excel object in C#,as the file is wrapped in the OLE Wrapper used by Access while inserting the file in database. I have tried locating the Header of Excel file from the byte array and...
0
1392
by: shaurya | last post by:
I need to open an Excel file that has been stored in the Access Database using the insert Object functionality of MSAccess manually. What i am aware of is that i cant just read the field containing the Excel File into a Byte Array and pass it to the Excel object in C#,as the file is wrapped in the OLE Wrapper used by Access while inserting the file in database . I have tried locating the Header of Excel file from the byte array and read...
2
4443
by: momukhtar | last post by:
I am using Win32::OLE to write a perl script which opens an excel file. That excel file is password protected and everytime i run that script dialog box pops up and I have to click on Read-Only then my script executes. Is there any way I can specify the readonly attribute in my code so i dont have to click on read only.
1
4763
by: barry.zhao | last post by:
Hi, I have a python program that constantly updates an excel spreadsheet. I would like to be able to view its updates while using excel to edit other excel files. Below are the test codes I have: -------------------------------------------------------------------------------------- from time import sleep import win32com.client as w32c
2
6099
by: frank knuckles | last post by:
After exporting an Access table to Excel, I would like to make the Excel file Read-Only. Is it possible to do this with VBA from within Access? Thanks. FK
1
2527
Soniad
by: Soniad | last post by:
Hi, I want to open an excel file from ASP Page, direclty. Means, Now I can open excel file on onclick by giving its path. But,it's prompting a dialog box with "Open/Save/Cancel" Option. I dont want these prompt.I need it to open directly in new window without asking these options. How to do this?
0
9923
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
11081
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
10709
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
10806
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
10394
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9544
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5773
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...
1
4592
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3214
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.