tags:

views:

23

answers:

2

Hi,

I'm trying to create a xls from a xml document (Its actually a xml which is created.. I kinda fool the registry to open it in Excel by naming it as .xls).

My question being... How do i make this excel read-only? That is.. is there any tags in xml that can make the spreadsheet readonly? Thanks in advance....

A: 

XML is an open standard markup file with text content. So it can be opened using any text editor and the content can be read. So even if you think of putting a tag for read-only attribute, it won't be of any use.

So You can not make it read-only as such.

Kangkan
+1  A: 

In office documents read only mode can be recommended (or forced with a password), this is MS office XML schema tag though. XML is just a set of rules for encoding documents in machine-readable form it doesn't define tag content.

<OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">
<ReadOnlyRecommended/>
</OfficeDocumentSettings>

Hypnos
Do note that you can "force" read-only mode, but savvy users can (of course) still effectively edit the document.
Borealid
Absolute true, this is by no means a data security feature.
Hypnos
Wow! This works!!!Thanks so much...A quick question.. Could you also send me the tags for making it password protected for modifying and opening?
Pramod
Unfortunately this is not possibly in my version of Excel (2003), so I cannot extract the tag. As I recall, this requires Excel 2007 or newer.
Hypnos
I kinda got the idea how to fetch it... I've got Excel 2007...Thank you so much!
Pramod