Reassign spreadsheet templates

Discuss the spreadsheet application
Locked
User avatar
White Phoenix
Posts: 312
Joined: Tue Jan 01, 2008 7:10 am

Reassign spreadsheet templates

Post by White Phoenix »

A long time ago I asked about a way to change / re-associate my open documents (specifically the spreadsheets) to a template. I have hundreds of orphaned files with either a template that no longer exists, or no template at all. This could be fixed if there was a way to change the template the file was based on, if any. This is why I gave up on using the Styles and Formatting and just change formatting on the fly and use templates that have preset sheets other than numbered 1 to 10 (or whatever the default was). I’ve basically customized just about everything even though some things don’t change when the template is changed. Different arrangement of sheets for example since that is not part of the formatting features.

Well I came across another orphaned template and decided to find a way to fix it.

First, I used to have a “1-sheet Spreadsheet.OTS”, but I decided that didn’t work out so well, so I deleted it. Unfortunately I just came across the one file that used it still in my system.
Second, even though I can, I don’t like going into the intricacies of stuff like registries and source code. I am not a professional, but every once in a while its necessary. This was one of those times. I know that open documents use XML and also they are very much like archives that can be accessed by any good archive manager like 7-Zip or File Roller.

I opened the broken spreadsheet with File Roller and looked at the different XML files that could be the problem. All I had to do was change “1-sheet Spreadsheet.OTS” to “Spreadsheet.OTS”.
I found the file I needed which was °meta.xml". Then I opened it up in Notepad++, found the places where the code read “1-sheet Spreadsheet.OTS” and changed each to “Spreadsheet.OTS”. I saved the file and closed it.
Then I opened the spreadsheet. It asked if I wanted to update and I did. When it opened everything was fine and the Properties showed it was using Spreadsheet.OTS as the template.

Well sure, now I know how to fix my old files, but if I could find a way to do this couldn’t a developer add a feature to change the template from inside the user interface with an option on the General tab under Properties. Years ago someone replied that LibreOffice can change the template. They were wrong. To this day LibreOffice still has no option to change the template of a file. At least not under Properties where it should be.

Now that I think about it. Maybe I could figure out a way to disable the annoying scrolling marque that’s used to highlight a selection of cells that LibreOffice does just because Excel does it that way.
Apache OpenOffice 4.1.15 on Linux Mint 21.3 with Cinnamon.
User avatar
Hagar Delest
Moderator
Posts: 33629
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Re-assigning Spreadsheet Templates

Post by Hagar Delest »

There is an extension to change the template, not sure if it still works but I used this one or its equivalent successfully with LibreOffice. See: [Solved] Plugin to apply a template to an existing document.
LibreOffice 25.2 on Linux Mint Debian Edition (LMDE 7 Gigi) and 25.2 portable on Windows 11.
User avatar
White Phoenix
Posts: 312
Joined: Tue Jan 01, 2008 7:10 am

Re: Reassign spreadsheet templates

Post by White Phoenix »

Ah, an extension. Maybe that is what they meant. Yes, I use another extension that is for LibreOffice, but works very well for my color project spreadsheet in OpenOffice.
There is only a direct link to the one you suggested. The other must be the one for LibreOffice. I tried going to the site but received an unprofessional “Zarro Boogs found.” message.
I went to the LibreOffice extensions site and found TemplateChanger-L-2.0.1.oxt here: https://extensions.libreoffice.org/en/e ... show/27416
I will check them both out and report which I preferred.
UPDATE:
Template-Changer-1.2.7d: The extension cannot be installed as the following dependencies are not fulfilled: Unknown
Template Changer 1.2.6 by André Schnabel: This extension enables you to assign a new template to writer documents. All styles and formatting will be loaded from that template and the document will behave as it was created using that template. (my emphasis)
Since I thought it wouldn’t matter what the template was for it should work for any Open Source file. So I will let you know if it works for Calc spreadsheets as well.
Apache OpenOffice 4.1.15 on Linux Mint 21.3 with Cinnamon.
User avatar
White Phoenix
Posts: 312
Joined: Tue Jan 01, 2008 7:10 am

Re: Reassign spreadsheet templates

Post by White Phoenix »

Well, I was hoping it would work somehow with any OpenOffice file, but it’s only designed for documents.I don’t have too much problems with documents. Maybe because I work with spreadsheets most of the time.
So, I’m back to square one until someone comes up with an extension to change the templates for Calc files.
Apache OpenOffice 4.1.15 on Linux Mint 21.3 with Cinnamon.
Locked