Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Saving template as non executable file

I have designed a password protected Excel template (.xlt)
which performs various calculations. As this template is
fairly large, I would like to give the user the option of
saving any calculation performed using the template as a
non executable document (.xls). If the document is to be
saved, only three of the six worksheets are required
(including the appropriate column and row settings), and
certain macros only would need to be retained (which are
run from buttons on the worksheet). Once the document has
been saved I would then like to give the user the option
of performing another calculation using the template or to
quit Excel if no other workbooks are currently open (using
a MsgBox or a UserForm).

I can write the VBA code required to delete the
appropriate worksheets and paste special the results of
the formula, but I'm struggling to work out the process of
saving/reopening the appropriate files.

Please, please, please could anybody point me in the right
direction. I would be very grateful for any suggestions
and/or snippets of useful code.

Many thanks.

Annie

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Saving template as non executable file


Paste the following into a blank macro on a book1 and run it. It shoul
save the file as "Order-(text in B4) (Current Date)" and then close th
file.

Dim wb As Workbook, strdate As String, sCurDir As String
strdate = Format(Now, "ddd, MMM dd yyyy hh-mm")
Set wb = ActiveWorkbook
sCurDir = Application.DefaultFilePath
ChDir Application.DefaultFilePath
wb.SaveAs "Order-" & Range("B4").Text _
& " " & strdate & ".xls"
wb.Saved = True
wb.Clos

--
CodeBange
-----------------------------------------------------------------------
CodeBanger's Profile: http://www.msusenet.com/member.php?userid=191
View this thread: http://www.msusenet.com/t-49415

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Document Not Saved" Saving File Created from Template PLEASEHELP!!!! Pamela[_3_] Excel Discussion (Misc queries) 1 February 5th 09 07:42 AM
getting an excel file to run as an executable excellenze Excel Discussion (Misc queries) 1 March 24th 06 07:45 PM
How can generate an executable file from Excel? Ofigomez Excel Discussion (Misc queries) 4 October 25th 05 01:17 PM
Convert excel file to executable file sparx Excel Discussion (Misc queries) 1 September 24th 05 01:36 PM
saving template Marlis Excel Discussion (Misc queries) 3 September 10th 05 11:09 PM


All times are GMT +1. The time now is 11:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"