Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
"Document Not Saved" Saving File Created from Template PLEASEHELP!!!! | Excel Discussion (Misc queries) | |||
getting an excel file to run as an executable | Excel Discussion (Misc queries) | |||
How can generate an executable file from Excel? | Excel Discussion (Misc queries) | |||
Convert excel file to executable file | Excel Discussion (Misc queries) | |||
saving template | Excel Discussion (Misc queries) |