OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Help for Excel User - Default Sheet Template

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
rmcintire
Newbie
Newbie


Joined: 29 Mar 2007
Posts: 2

PostPosted: Thu Mar 29, 2007 1:30 pm    Post subject: Help for Excel User - Default Sheet Template Reply with quote

I have searched all over but have not been able to find the answer to my specific question. I'm hoping someone can help.

I have successfully created a default template for my spreadsheet using the workbook template I used in Excel. Now I'm trying to convert my sheet template (worksheet in Excel) so that when I do Insert -> Sheet, it inserts a new worksheet in the correct format (I have a custom header and footer as well as conditional formatting for both the spreadsheet and sheet). Currently when I insert, it's a blank sheet (the OO Calc default).

Any suggestions? Thanks in advance for your input.
Back to top
View user's profile Send private message
noranthon
Super User
Super User


Joined: 07 Jul 2005
Posts: 3323

PostPosted: Thu Mar 29, 2007 9:01 pm    Post subject: Reply with quote

First, you need to save the document as a template - File >Templates >Save. Then you need to set it as the default template - File >Templates >Organise.
_________________
search forum by month
Back to top
View user's profile Send private message Visit poster's website
rmcintire
Newbie
Newbie


Joined: 29 Mar 2007
Posts: 2

PostPosted: Fri Mar 30, 2007 7:09 am    Post subject: Reply with quote

Thanks for the reply, but it doesn't fix my situation.

In Excel, you can specify both a Book and Sheet template and place them in the XLSTART directory. The Book template becomes your default spreadsheet and when you insert new worksheets, the Sheet template is used.

I already have my Spreadsheet template setup and set as the default. It looks and works fine. What I need now is to specify the default Sheet template so that when I insert a new sheet, it uses the template (rather than having to insert a sheet from a file).

Thanks again for any suggestions.
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 7649
Location: Germany

PostPosted: Fri Mar 30, 2007 9:08 am    Post subject: Reply with quote

Very simple macro which copies a (hidden) sheet within this workbook.
Adjust constant "Template" to the sheet's name.
Code:

sub copyTemplate()
'calls: getUniqueName
Const SourceSheet$ = "Template"
dim oSheets, sName
   oSheets = thisComponent.getSheets()
   sName = getUniqueName(oSheets,SourceSheet)
   ' copy sheet named SourceSheet as sName to first position 0:
   oSheets.copyByName(SourceSheet,sName,0)
end sub
Function getUniqueName(oContainer,sName$)
Dim i%,sNew$
sNew = sName
Do while oContainer.hasByName(sNew)
   i = i +1
   sNew = sName &"_"& i      
loop
getUniqueName = sNew
End Function

_________________
XUbuntu 9.04, OOo 3.1.1(Sun), Sun Java 1.5.0_06
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group