Skip to main content
1-Visitor
February 1, 2011
Question

Editing header and footer while worksheet is protected

  • February 1, 2011
  • 5 replies
  • 8804 views

Dear All,

Please let me know whether I can edit the header and footer if the worksheet is locked.

I need this so I can edit the document no which is in the header and footer.\

Suppose I can't do this then how do I insert the document no in such a way in the worksheet that it automatically displays in all the pages of the worksheet.

5 replies

1-Visitor
February 1, 2011

Please let me know whether I can edit the header and footer if the worksheet is locked.

If the worksheet has been locked for editing, no.

Suppose I can't do this then how do I insert the document no in such a way in the worksheet that it automatically displays in all the pages of the worksheet.

These are very cumbersome workaround's, but they might work.

  • Firstly, can you not get the worksheet unlocked? What version is it? Some members in the old forum where able to unlock sheets.
  • If the file is printed to *.pdf and you have Acrobat you could insert the document number then.
  • Create the document number in a text file in Mathcad and have it at the bottom of each page. If the worksheet is locked for editing you are allowed to change the page margins - reduce them so they cut the header and footer off.

Mike

http://communities.ptc.com/servlet/JiveServlet/showImage/2-149416-2532/bar_anim.gif

19-Tanzanite
February 1, 2011
Some members in the old forum where able to unlock sheets

I don't think that's quite true. I don't recall anyone saying they knew how to unprotect the worksheet. Even if they did, it probably would only apply to worksheets created in version 2001 or earlier.

I, and a couple of others, know how to unlock collapsed areas. For worksheets saved using version 2001i or later there are some specific requirements for that to be possible though, one of which is that the worksheet is not protected for editing.

1-Visitor
February 1, 2011
I don't think that's quite true. I don't recall anyone saying they knew how to unprotect the worksheet. Even if they did, it probably would only apply to worksheets created in version 2001 or earlier.

Maybe that is what I meant.

I, and a couple of others, know how to unlock collapsed areas. For worksheets saved using version 2001i or later there are some specific requirements for that to be possible though, one of which is that the worksheet is not protected for editing.

Care to share the secret?

Mike

http://communities.ptc.com/servlet/JiveServlet/showImage/2-149416-2532/bar_anim.gif

1-Visitor
February 1, 2011

Assuming that the problem is of this sort... where the sheet is locked before the number is assigned, but you do know this in advance...

Then I would suggest that you use the XML code settings and VBscript to get at a windows file properties value so that you then pass the value into the shhet at execution, even though it is locked.

Basically you add the document number to the windows file metadata (that is a right click in windows explorer), which is then accessed inside the worksheet. I 'think', but I'm not sure, that you can have the header data based on the worksheet XML data (Under the file menu properties inside mathcad). It (if it works) is a bit of a phaff, but should be possible.

Again this presuposes that you can set up a template so that you can allocate the document number after you have protected it. If it is a pre-existing sheet you will need help to crack the lost password.

Philip

1-Visitor
February 1, 2011

What version of Mathcad was the sheet saved in?

Mike

http://communities.ptc.com/servlet/JiveServlet/showImage/2-149416-2532/bar_anim.gif

19-Tanzanite
February 3, 2011

Is this a one-off request, or a general need?

Debayan1-VisitorAuthor
1-Visitor
February 4, 2011

Thanks all,

No Bogeyman, it is not a one off requirement If there is a workaround then it will be used on an entire project which will be paid by client, so I guess unoffical methods of getting this work done is out of the question.

Actually it is quite frustrating to know that MathCAD doesn't have provisions of this sort.

Although I agree that unlike excel, MathCAD is one BIG active cell, but if it markets itself with the tagline 'Spend more time engineering and less time documenting' , then MathCAD at times really falls short.

But maybe as a new user it is my frustration speaking and MathCAD might not be that frustrating after all.

19-Tanzanite
February 4, 2011
No Bogeyman, it is not a one off requirement If there is a workaround then it will be used on an entire project which will be paid by client, so I guess unoffical methods of getting this work done is out of the question.

I think that depends on the nature of the project and why the page numbers were not added before the worksheets were protected. If, say, it's a design for a bridge that has been approved at multiple levels, and the worksheets then locked, there is no way I would be the person that modified those worksheets in any way at all. If the bridge then had a problem, guess whose door they would be knocking on!

Actually it is quite frustrating to know that MathCAD doesn't have provisions of this sort.

Well, it does, mostly. You can set any region in the worksheet to allow editing when the worksheet as a whole is protected for editing. Unfortunately, the header and footer are not considered regions, and you can't allow editing of these. An oversight, I guess. But even if that was allowed it wouldn't do you any good, because you would have to allow them to be edited before you protected the worksheet. Presumably that wouldn't have been done, because is someone had thought of that they would have added the page numbers in the first place.

The reason I asked if it was a one-off is that I was going to offer to change the footer for you, but I wasn't prepared to post how to do that (as a personal policy, I don't post information that would allow one person to violate another persons security). Now that someone has posted how to unprotect a worksheet though, I guess the cat is out of the bag. You don't need to actually unprotect the sheet. Change the extension from .xmcdz to .zip, and unzip the file. Then change the extension to .xmcd. Open the file in Notepad and modify the section of XML for the footer (it's near the top of the file). You can get the desired XML by creating a new file with the footer you want, and just copying and pasting. Save the file.

1-Visitor
February 4, 2011

Mathcad document protection unlock procedure:

1) save document as *.xmcdz;
2) open new xmcdz-file as archive and copy from its content (enhancementless);
3) open dearchived file in any text redactor and by force of CTRL+F find textline with word password;
4) finded textlin deleted, then CTRL+S;
5) “modificated” file inserted back into xmcdz-file(archive);
6) open xmcdz-file in Mathcad - voilà

1-Visitor
February 4, 2011

Mathcad document protection unlock procedure:

1) save document as *.xmcdz;
2) open new xmcdz-file as archive and copy from its content (enhancementless);
3) open dearchived file in any text redactor and by force of CTRL+F find textline with word password;
4) finded textlin deleted, then CTRL+S;
5) “modificated” file inserted back into xmcdz-file(archive);
6) open xmcdz-file in Mathcad - voilà

Could you elaborate on the steps required to unlock?

Mike

http://communities.ptc.com/servlet/JiveServlet/showImage/2-149416-2532/bar_anim.gif

1-Visitor
February 5, 2011

OK. Let's admit, we have the protected from editing worksheet (created in Mathcad v11...15 [and may be an earlier versions..]) and want to unlock it.

Step 1: Open this worksheet in Mathcad and Save it as a Mathcad Compressed XML Document file (*.xmcdz).

Step 2: Open this last created xmcdz-file as an archive (e.g. in Total Commander, WinRAR etc.) and extract from it its content (enhancementless file with identical name).

Step 3: Find on disk and open the extracted file in any text redactor (e.g. in WordPad) and by force of combination CTRL+F search the text string which contains the word protection or password (e.g. <protection protection-level="high" password="bla-bla-bla" />).

Step 4: Completely delete the founded text string and save file (CTRL+S).

Step 5: “Modificated” file inserted back (packed) into the xmcdz-file(archive) (for this operation I used Total Commander).

Step 6: Open xmcdz-file in Mathcad and see that protection is removed from the worksheet.

P.S. But the protection of worksheet areas (in menu: Insert ---> Area; and which then locked) cannot be removed in such a way.